diff options
author | Ted Gould <ted@gould.cx> | 2011-03-23 14:46:23 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-03-23 14:46:23 -0500 |
commit | 53691e5c73a343fec78e6782089e092bd6bcd3ac (patch) | |
tree | c89ae4902111858a3b6def7811e44bb34c7fc062 /libdbusmenu-gtk | |
parent | 3c9af9576901318917a4c20ab668742255bbe429 (diff) | |
parent | e7acae9db34e6abea6b7aa1fe532ad18e13577c7 (diff) | |
download | libdbusmenu-53691e5c73a343fec78e6782089e092bd6bcd3ac.tar.gz libdbusmenu-53691e5c73a343fec78e6782089e092bd6bcd3ac.tar.bz2 libdbusmenu-53691e5c73a343fec78e6782089e092bd6bcd3ac.zip |
Import upstream version 0.4.0
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r-- | libdbusmenu-gtk/menuitem.c | 11 | ||||
-rw-r--r-- | libdbusmenu-gtk/parser.c | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/libdbusmenu-gtk/menuitem.c b/libdbusmenu-gtk/menuitem.c index b3358fe..ca2bc3e 100644 --- a/libdbusmenu-gtk/menuitem.c +++ b/libdbusmenu-gtk/menuitem.c @@ -236,8 +236,15 @@ dbusmenu_menuitem_property_set_shortcut_menuitem (DbusmenuMenuitem * menuitem, c NULL); } - if (closure == NULL) - return FALSE; + if (closure == NULL) { + /* As a fallback, check for a closure in the related menu item. This + actually happens with SWT menu items. */ + GList * closures = gtk_widget_list_accel_closures (GTK_WIDGET (gmi)); + if (closures == NULL) + return FALSE; + closure = closures->data; + g_list_free (closures); + } GtkAccelGroup * group = gtk_accel_group_from_accel_closure(closure); diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 9d93a1e..a7f90a2 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -845,7 +845,9 @@ item_activated (DbusmenuMenuitem *item, guint timestamp, gpointer user_data) if (GTK_IS_MENU_ITEM (child)) { + gdk_threads_enter (); gtk_menu_item_activate (GTK_MENU_ITEM (child)); + gdk_threads_leave (); } } } |