Revert "combobox: remove superfluous GTK+ grabs"
authorDaniel Boles <dboles@src.gnome.org>
Mon, 28 Aug 2017 17:38:45 +0000 (18:38 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Mon, 28 Aug 2017 19:00:59 +0000 (20:00 +0100)
This reverts commit 46b4e5d38877197503f802380e5c9a469218f99b.

Apparently these weren’t so redundant, because their removal introduced
at least 2 bugs in list-mode ComboBoxes: failure to close the popup upon
clicking out of it, and failing to receive mouse input in the popup of a
CB in a modal window. It may also have caused (even more!) stuck grabs.

https://bugzilla.gnome.org/show_bug.cgi?id=738387
https://bugzilla.gnome.org/show_bug.cgi?id=776793

gtk/gtkcombobox.c

index fa1e26c238868590883b110d27eb137f76a5e3b5..ede2fba62531bd4223f40eff287357d6a70f4504 100644 (file)
@@ -2374,6 +2374,7 @@ gtk_combo_box_popup_for_device (GtkComboBox *combo_box,
       return;
     }
 
+  gtk_device_grab_add (priv->popup_window, pointer, TRUE);
   priv->grab_pointer = pointer;
 
   g_signal_connect (priv->popup_window,
@@ -2448,6 +2449,7 @@ gtk_combo_box_popdown (GtkComboBox *combo_box)
   if (priv->grab_pointer)
     gdk_seat_ungrab (gdk_device_get_seat (priv->grab_pointer));
 
+  gtk_device_grab_remove (priv->popup_window, priv->grab_pointer);
   gtk_widget_hide (priv->popup_window);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button),
                                 FALSE);