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.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2375 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2008-03-21 13:05:47 +00:00
parent 98f57f2543
commit 5bb5ff514f
2 changed files with 16 additions and 9 deletions

View File

@ -1,3 +1,11 @@
2008-03-21 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* 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 <enrico(dot)troeger(at)uvena(dot)de>
* HACKING: Add note and link for GTK 2.6 API docs.

View File

@ -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);
}
}