aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorAlbert Astals <albert.astals@canonical.com>2012-10-16 12:57:42 +0200
committerAlbert Astals <albert.astals@canonical.com>2012-10-16 12:57:42 +0200
commitf107cada953899d4077198f4c4cc0fff62229a0a (patch)
tree474121ae9055cd43afc49bbfb0ddcd2c5a33265d /libdbusmenu-gtk
parent59975c98291d252bdb1b7c955376d6498dfafea6 (diff)
downloadlibdbusmenu-f107cada953899d4077198f4c4cc0fff62229a0a.tar.gz
libdbusmenu-f107cada953899d4077198f4c4cc0fff62229a0a.tar.bz2
libdbusmenu-f107cada953899d4077198f4c4cc0fff62229a0a.zip
Call gtk_menu_set_active with the position of the activated menu item
Fixes interaction with GtkRecentChooserMenu (bug 752674)
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..5d49c7e 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 ();