aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorAlbert Astals <albert.astals@canonical.com>2012-10-16 20:43:53 +0000
committerTarmac <Unknown>2012-10-16 20:43:53 +0000
commit878ae818c41c86a96f8f3a309a591cc9f2927ea8 (patch)
tree87166d11462d28265f8d4908982e594618edd8ca /libdbusmenu-gtk
parent59975c98291d252bdb1b7c955376d6498dfafea6 (diff)
parent3019e05fc39f667a14affe5ec6a65aded93d0512 (diff)
downloadlibdbusmenu-878ae818c41c86a96f8f3a309a591cc9f2927ea8.tar.gz
libdbusmenu-878ae818c41c86a96f8f3a309a591cc9f2927ea8.tar.bz2
libdbusmenu-878ae818c41c86a96f8f3a309a591cc9f2927ea8.zip
Call gtk_menu_set_active with the position of the activated menu item
Fixes interaction with GtkRecentChooserMenu (bug 752674). Fixes: https://bugs.launchpad.net/bugs/752674. Approved by Ted Gould.
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r--libdbusmenu-gtk/parser.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index 39cc9f8..1658bdc 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -1121,6 +1121,14 @@ item_activated (DbusmenuMenuitem *item, guint timestamp, gpointer user_data)
if (GTK_IS_MENU_ITEM (child))
{
+ GtkWidget *parent = gtk_widget_get_parent(child);
+ if (GTK_IS_MENU (parent))
+ {
+ gint pos = get_child_position (child);
+ if (pos >= 0)
+ gtk_menu_set_active (GTK_MENU(parent), pos);
+ }
+
gdk_threads_enter ();
gtk_menu_item_activate (GTK_MENU_ITEM (child));
gdk_threads_leave ();