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 658563 - Do not allow offscreen widgets to take grabs.
Do not allow offscreen widgets to take grabs.
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GdkDevice
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
Carlos Garnacho
: 607668 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-08 13:55 UTC by Robert Carr
Modified: 2018-05-02 15:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (1.08 KB, patch)
2011-09-08 13:55 UTC, Robert Carr
none Details | Review
main: Do not allow offscreen widgets to take grabs (1.90 KB, patch)
2017-09-17 16:42 UTC, Daniel Boles
none Details | Review

Description Robert Carr 2011-09-08 13:55:47 UTC
Created attachment 195989 [details] [review]
Patch

In gtk_grab_add and gtk_device_grab_add, it makes sense to check if the widget is offscreen before allowing it to make a grab. 

1. We don't want offscreen widgets closing menus, etc...
2. If the widget is put in an offscreen hierarchy it probably indicates that the user wants greater control over the widget.
Comment 1 Martin Pitt 2011-11-22 08:57:26 UTC
If someone wants to ack this patch, please also have a look at bug 607668, which fixes the corresponding problem in gtk_grab_add().
Comment 2 Emmanuele Bassi (:ebassi) 2012-10-31 11:11:23 UTC
Review of attachment 195989 [details] [review]:

two minor coding style issues.

I think it makes sense, but I'll leave somebody else to ACK it.

::: gtk/gtkmain.c
@@ +2211,3 @@
+  
+  toplevel = gdk_window_get_toplevel (gtk_widget_get_window (widget));
+  if (toplevel && 

add != NULL to the top-level check, as per coding style.

@@ +2306,3 @@
+  
+  toplevel = gdk_window_get_toplevel (gtk_widget_get_window (widget));
+  if (toplevel && 

same as above.
Comment 3 Daniel Boles 2016-10-25 10:42:49 UTC
*** Bug 607668 has been marked as a duplicate of this bug. ***
Comment 4 Daniel Boles 2016-10-25 10:43:18 UTC
AFAICT these patches (and their counterparts applied in Debian) will become redundant in GTK+ 4 with this commit:
https://git.gnome.org/browse/gtk+/commit/?id=70935f09526ba9f1d0b2f6af10e18712df73eda9

The ComboBox menu popup/selection ordering issue that this patch revealed should probably still be fixed, though.
Comment 5 Daniel Boles 2017-08-29 23:35:24 UTC
Debian has been applying patches preventing offscreen grabs to its GTK+ 3 for ages.

Is there any chance of these being applied upstream, or is it too late and this should be marked obsolete?
Comment 6 Daniel Boles 2017-09-17 16:42:36 UTC
Created attachment 359934 [details] [review]
main: Do not allow offscreen widgets to take grabs

In gtk_grab_add and gtk_device_grab_add, it makes sense to check if the
widget is offscreen before allowing it to make a grab.

1. We don't want offscreen widgets closing menus, etc...
2. If the widget is put in an offscreen hierarchy it probably indicates
   that the user wants greater control over the widget.

updated style and git-formatted by Daniel Boles <dboles@src.gnome.org>


--

In case it can still go in, here's a git-formatted version with Emmanuele's
review comment and another minor style fix applied (authorship preserved)
Comment 7 GNOME Infrastructure Team 2018-05-02 15:12:11 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/368.