← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~bratsche/dbusmenu/grab-your-junk into lp:dbusmenu

 

Cody Russell has proposed merging lp:~bratsche/dbusmenu/grab-your-junk into lp:dbusmenu.

Requested reviews:
  DBus Menu Team (dbusmenu-team)

-- 
https://code.launchpad.net/~bratsche/dbusmenu/grab-your-junk/+merge/34125
Your team ayatana-commits is subscribed to branch lp:dbusmenu.
=== modified file 'libdbusmenu-gtk/client.c'
--- libdbusmenu-gtk/client.c	2010-08-20 21:47:06 +0000
+++ libdbusmenu-gtk/client.c	2010-08-30 20:15:50 +0000
@@ -447,18 +447,26 @@
 		GtkWidget * attach = gtk_menu_get_attach_widget(GTK_MENU(shell));
 
 		if (attach != NULL) {
-			GtkWidget * parent = gtk_widget_get_parent(GTK_WIDGET(attach));
+                        GtkWidget * parent = gtk_widget_get_parent(attach);
+                        GtkWidget *toplevel = gtk_widget_get_toplevel (attach);
 
 			if (parent != NULL) {
 				if (GTK_IS_MENU(parent)) {
 					activate_helper(GTK_MENU_SHELL(parent));
 				}
+
+                                if (!GTK_MENU_SHELL (parent)->active) {
+                                        gtk_grab_add (parent);
+                                        GTK_MENU_SHELL (parent)->have_grab = TRUE;
+                                        GTK_MENU_SHELL (parent)->active = TRUE;
+                                }
+
 				gtk_menu_shell_select_item(GTK_MENU_SHELL(parent), attach);
 			}
 		}
 	}
 
-	return;
+        return;
 }
 
 /* Signaled when we should show a menuitem at request of the application


Follow ups