diff --git a/ChangeLog b/ChangeLog index a4463504..59458b4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-03-21 Nick Treleaven + + * src/notebook.c: + When closing tabs that were opened left-to-right, don't temporarily + focus the previous tab when closing tabs, to prevent unnecessary + checking for disk changes. + + 2008-03-20 Enrico Tröger * HACKING: Add note and link for GTK 2.6 API docs. diff --git a/src/notebook.c b/src/notebook.c index adf5ee41..3d86cf4e 100644 --- a/src/notebook.c +++ b/src/notebook.c @@ -409,19 +409,18 @@ notebook_tab_close_clicked_cb(GtkButton *button, gpointer user_data) /* Always use this instead of gtk_notebook_remove_page(). */ void notebook_remove_page(gint page_num) { - gint oldpage = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->notebook)); + gint curpage = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->notebook)); + /* Focus the next page, not the previous */ + if (curpage == page_num && prefs.tab_order_ltr) + { + gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), curpage + 1); + } + + /* now remove the page (so we don't temporarily switch to the previous page) */ gtk_notebook_remove_page(GTK_NOTEBOOK(app->notebook), page_num); tab_count_changed(); - - /* Focus the next page, not the previous */ - if (oldpage == page_num && prefs.tab_order_ltr) - { - /* Unless the first tab was closed */ - if (oldpage > 0) - gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), oldpage); - } }