aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2011-03-21 12:06:57 -0400
committerMichael Terry <mike@mterry.name>2011-03-21 12:06:57 -0400
commit6249256f1d55968f054e0dcbac01591c0fa01da1 (patch)
tree5bf3cdbe66bca0e95db54ce8d5958bf19c0cc1b0
parent746a792ef912c5160fed15bf817df5124f6610b0 (diff)
downloadlibdbusmenu-6249256f1d55968f054e0dcbac01591c0fa01da1.tar.gz
libdbusmenu-6249256f1d55968f054e0dcbac01591c0fa01da1.tar.bz2
libdbusmenu-6249256f1d55968f054e0dcbac01591c0fa01da1.zip
check menu items for accelerators directly if accel label doesn't have one
-rw-r--r--libdbusmenu-gtk/menuitem.c11
1 files changed, 9 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);