Kaydet (Commit) 3cf1f7aa authored tarafından Enrico Tröger's avatar Enrico Tröger

Explicitly check for the type when iterating the action's proxies. For some…

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

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4922 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 48064120
......@@ -8,6 +8,10 @@
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>
......
......@@ -213,20 +213,21 @@ static void menu_items_changed_cb(GtkContainer *container, GtkWidget *widget, Ge
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);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment