diff options
author | Ted Gould <ted@gould.cx> | 2011-03-23 11:43:20 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-03-23 11:43:20 -0500 |
commit | 4008b1cde10567e4aff2beb863a4702808b5d1e2 (patch) | |
tree | 6e0d579e6ed5018471243824c0c862bd784fe01a /libdbusmenu-gtk/menuitem.c | |
parent | 3dbe8f6e4c67a20123850253bde758811fb97dbc (diff) | |
parent | d6db0878e84ee8e290cdbb6431986fcc79928861 (diff) | |
download | libdbusmenu-4008b1cde10567e4aff2beb863a4702808b5d1e2.tar.gz libdbusmenu-4008b1cde10567e4aff2beb863a4702808b5d1e2.tar.bz2 libdbusmenu-4008b1cde10567e4aff2beb863a4702808b5d1e2.zip |
* Upstream Merge
* Protect from NULL variants by using iter_loop (LP: #737844)
* Look for accellerators inside the labels as well
Diffstat (limited to 'libdbusmenu-gtk/menuitem.c')
-rw-r--r-- | libdbusmenu-gtk/menuitem.c | 11 |
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); |