After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 782870 - X11 Grabbing Broken with GtkScrolledWindow
X11 Grabbing Broken with GtkScrolledWindow
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkScrolledWindow
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-05-20 15:48 UTC by Ikey Doherty
Modified: 2017-09-05 01:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GTK3 test program of ScrolledWindow + grab APIS. Broken scrollbar. (3.65 KB, text/x-csrc)
2017-05-20 15:48 UTC, Ikey Doherty
  Details
GTK2 test program of ScrolledWindow + grab APIs. Scrollbar works. (3.74 KB, text/x-csrc)
2017-05-20 15:49 UTC, Ikey Doherty
  Details
gtkgesture: Do not ignore events from other GdkWindows than the widget's (1.08 KB, patch)
2017-06-26 17:32 UTC, Carlos Garnacho
committed Details | Review
gtkrange: Reinstaurate GTK+ grabs while manipulating ranges (1.04 KB, patch)
2017-06-26 17:32 UTC, Carlos Garnacho
committed Details | Review

Description Ikey Doherty 2017-05-20 15:48:05 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.
Comment 1 Ikey Doherty 2017-05-20 15:48:59 UTC
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
Comment 2 Ikey Doherty 2017-05-20 15:49:43 UTC
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
Comment 3 Ikey Doherty 2017-05-20 15:50:22 UTC
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.
Comment 4 Ikey Doherty 2017-06-26 13:08:41 UTC
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.
Comment 5 Carlos Garnacho 2017-06-26 17:32:46 UTC
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.
Comment 6 Carlos Garnacho 2017-06-26 17:32:52 UTC
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.
Comment 7 Ikey Doherty 2017-06-27 10:33:41 UTC
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
Comment 8 Carlos Garnacho 2017-07-26 11:07:20 UTC
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