GNOME Bugzilla – Bug 658563
Do not allow offscreen widgets to take grabs.
Last modified: 2018-05-02 15:12:11 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.
If someone wants to ack this patch, please also have a look at bug 607668, which fixes the corresponding problem in gtk_grab_add().
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.
*** Bug 607668 has been marked as a duplicate of this bug. ***
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.
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?
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)
-- 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.