SF.net SVN: geany: [2375] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Fri Mar 21 13:05:48 UTC 2008


Revision: 2375
          http://geany.svn.sourceforge.net/geany/?rev=2375&view=rev
Author:   ntrel
Date:     2008-03-21 06:05:47 -0700 (Fri, 21 Mar 2008)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/notebook.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-03-20 17:05:45 UTC (rev 2374)
+++ trunk/ChangeLog	2008-03-21 13:05:47 UTC (rev 2375)
@@ -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.

Modified: trunk/src/notebook.c
===================================================================
--- trunk/src/notebook.c	2008-03-20 17:05:45 UTC (rev 2374)
+++ trunk/src/notebook.c	2008-03-21 13:05:47 UTC (rev 2375)
@@ -409,19 +409,18 @@
 /* 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));
 
-	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)
+	if (curpage == 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);
+		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();
 }
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list