diff options
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 (); } } } |