menu: Avoid cancelling the menu on GTK+ grabs inside the GtkMenu
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 10 Aug 2017 09:56:47 +0000 (11:56 +0200)
committerJeremy Bicha <jbicha@ubuntu.com>
Tue, 29 Aug 2017 00:39:28 +0000 (01:39 +0100)
Allows again sliders as menuitems, broken by commit 9b032073.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=786029
Bug-Ubuntu: https://launchpad.net/bugs/1712701
Bug-Debian: https://bugs.debian.org/872687

Gbp-Pq: Name fix-gtk-menu-sliders.patch

gtk/gtkmenu.c

index 2308040ef2f89bfc3b1b9b84e4f49d4ac2c96771..c443cfeb22d8703e26e35d6cae1a42c18c5bce87 100644 (file)
@@ -6183,7 +6183,8 @@ gtk_menu_grab_notify (GtkWidget *widget,
   group = gtk_window_get_group (GTK_WINDOW (toplevel));
   grab = gtk_window_group_get_current_grab (group);
 
-  if (GTK_MENU_SHELL (widget)->priv->active && !GTK_IS_MENU_SHELL (grab))
+  if (GTK_MENU_SHELL (widget)->priv->active && !GTK_IS_MENU_SHELL (grab) &&
+      !gtk_widget_is_ancestor (grab, widget))
     gtk_menu_shell_cancel (GTK_MENU_SHELL (widget));
 
   menu->priv->drag_scroll_started = FALSE;