SF.net SVN: geany:[4922] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun May 16 17:43:35 UTC 2010


Revision: 4922
          http://geany.svn.sourceforge.net/geany/?rev=4922&view=rev
Author:   eht16
Date:     2010-05-16 17:43:35 +0000 (Sun, 16 May 2010)

Log Message:
-----------
Explicitly check for the type when iterating the action's proxies. For some reason on Windows, a GtkImageMenuItem proxy is created.

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-05-16 17:43:24 UTC (rev 4921)
+++ trunk/ChangeLog	2010-05-16 17:43:35 UTC (rev 4922)
@@ -8,7 +8,11 @@
    Small improvements to speed up quit process with many open documents.
    Avoid calling gtk_notebook_remove_page() on exit as it takes
    a lot of time.
+ * src/geanymenubuttonaction.c:
+   Explicitly check for the type when iterating the action's proxies.
+   For some reason on Windows, a GtkImageMenuItem proxy is created.
 
+
 2010-05-15  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
 
  * src/win32.c:

Modified: trunk/src/geanymenubuttonaction.c
===================================================================
--- trunk/src/geanymenubuttonaction.c	2010-05-16 17:43:24 UTC (rev 4921)
+++ trunk/src/geanymenubuttonaction.c	2010-05-16 17:43:35 UTC (rev 4922)
@@ -213,20 +213,21 @@
 	else
 		enable = FALSE;
 
-	if (enable)
+	foreach_slist(l, gtk_action_get_proxies(GTK_ACTION(action)))
 	{
-		foreach_slist(l, gtk_action_get_proxies(GTK_ACTION(action)))
+		/* On Windows a GtkImageMenuItem proxy is created for whatever reason. So we filter
+		 * by type and act only on GtkMenuToolButton proxies. */
+		/* TODO find why the GtkImageMenuItem proxy is created */
+		if (! GTK_IS_MENU_TOOL_BUTTON(l->data))
+			continue;
+
+		if (enable)
 		{
 			if (gtk_menu_tool_button_get_menu(GTK_MENU_TOOL_BUTTON(l->data)) == NULL)
 				gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(l->data), priv->menu);
 		}
-	}
-	else
-	{
-		foreach_slist(l, gtk_action_get_proxies(GTK_ACTION(action)))
-		{
+		else
 			gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(l->data), NULL);
-		}
 	}
 }
 


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