GNOME Bugzilla – Bug 782870
X11 Grabbing Broken with GtkScrolledWindow
Last modified: 2017-09-05 01:15:38 UTC
When using a GtkScrolledWindow within a GtkWindow, and claiming an X11 grab, the scrollbars can only be dragged along their primary axis, i.e. within the trough confines. The expected behaviour is that the window has global grab state within X, and the scrollbar should be draggable outside the confines of the trough *and* the application. This bug is GTK3 specific, and does not appear in GTK2.
Created attachment 352226 [details] GTK3 test program of ScrolledWindow + grab APIS. Broken scrollbar. Added GTK3 test program of ScrolledWindow + grab APIS. Broken scrollbar. gcc -Wall -Werror `pkg-config --cflags --libs gtk+-3.0` main.c -o gtk3_test
Created attachment 352227 [details] GTK2 test program of ScrolledWindow + grab APIs. Scrollbar works. Added GTK2 test program of ScrolledWindow + grab APIs. Scrollbar works. gcc -Wall -Werror `pkg-config --cflags --libs gtk+-2.0` main2.c -o gtk2_test
Note that using the legacy GDK APIs (gdk_pointer_grab/gdk_keyboard_grab) within the GTK3 program (-Wno-deprecated -Wno-error) still doesn't resolve the issue, as it is specific to the GtkScrolledWindow grabs.
Further, this is now a problem with Budgie Desktop too, which uses X11 grabs for the toplevel windows such as the Budgie Menu. Any clues or insight how to debug this would be appreciated.
Created attachment 354527 [details] [review] gtkgesture: Do not ignore events from other GdkWindows than the widget's There's GDK grab situations (eg. pointer motion outside the grab window in combination with a GTK+ grab) where a gesture may receive events from windows that are not the widget's. The _update_widget_coordinates() still does work for those situations, so just let these events go through instead of ignoring them.
Created attachment 354528 [details] [review] gtkrange: Reinstaurate GTK+ grabs while manipulating ranges It should not be necessary for most situations, except while there's GDK grabs coercing events in a different way.
Hey Carlos, I don't know if you were looking for confirmation or not but that works perfectly against GTK3.22, thank you! You're gonna make a lot of people happy :D
Attachment 354527 [details] pushed as 54c26e0 - gtkgesture: Do not ignore events from other GdkWindows than the widget's Attachment 354528 [details] pushed as 9b03207 - gtkrange: Instaurate GTK+ grabs while manipulating ranges