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 771859 - wayland: Some more Xwayland pointer constraint fixes
wayland: Some more Xwayland pointer constraint fixes
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks: WaylandRelated
 
 
Reported: 2016-09-23 03:24 UTC by Jonas Ådahl
Modified: 2016-10-13 05:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland/pointer-constraints: Disable or remove when grab is cancelled (3.62 KB, patch)
2016-09-23 03:24 UTC, Jonas Ådahl
committed Details | Review
wayland/pointer-constraints: Unify requirements for enablement (3.50 KB, patch)
2016-09-23 03:24 UTC, Jonas Ådahl
committed Details | Review
wayland/pointer-constraints: Don't include window frame in region (2.37 KB, patch)
2016-09-23 03:24 UTC, Jonas Ådahl
committed Details | Review

Description Jonas Ådahl 2016-09-23 03:24:08 UTC
These patches fixes the following issue:

 * Pointer warping via Xwayland done by wine should now work. Needs yet to be
   published Xwayland patches though.
 * Minecraft should no longer get stuck in click means window resize issues
   happening for example when going from fullscreen to windowed mode.
Comment 1 Jonas Ådahl 2016-09-23 03:24:12 UTC
Created attachment 336134 [details] [review]
wayland/pointer-constraints: Disable or remove when grab is cancelled

When the grab is cancelled, for example because of an Alt-tab, VT
switch etc, disable or remove (depending on the constraint type) the
constraint. This avoids a re-entry issue when the focus is returned and
the focus listener tries to re-enable a disabled constraint.
Comment 2 Jonas Ådahl 2016-09-23 03:24:17 UTC
Created attachment 336135 [details] [review]
wayland/pointer-constraints: Unify requirements for enablement

Put the conditions for enabling a pointer constraint in a helper
function, and use that in both maybe_enable() and maybe_remove(). The
constraint region checking is still only done in maybe_enable()
however.

This changes the conditions for maybe disabling the constraint on focus
change and other trigger points, namely it makes constraints by Xwayland
not disable when they shouldn't due to the constraining window being an
override-redirect window.
Comment 3 Jonas Ådahl 2016-09-23 03:24:22 UTC
Created attachment 336136 [details] [review]
wayland/pointer-constraints: Don't include window frame in region

When Xwayland confines, the surface dimensions will include the server
side window manager decorations. We don't want the decorations to be
included in the constraint region so intersect the calculated input
region with the parts of the buffer rect that is not part of the window
frame.
Comment 4 Carlos Garnacho 2016-10-12 10:59:57 UTC
Comment on attachment 336134 [details] [review]
wayland/pointer-constraints: Disable or remove when grab is cancelled

LGTM. As a matter of personal taste, I'd like "deactivate" more than "remove_or_disable". I have the feeling that internal API is growing too verbose here :).
Comment 5 Carlos Garnacho 2016-10-12 11:02:24 UTC
Comment on attachment 336135 [details] [review]
wayland/pointer-constraints: Unify requirements for enablement

Makes sense, should we maybe add comments in the places where we are loosening restrictions for xwayland? although I guess boils down to the callers of this function.
Comment 6 Carlos Garnacho 2016-10-12 11:05:47 UTC
Comment on attachment 336136 [details] [review]
wayland/pointer-constraints: Don't include window frame in region

Looks good, I guess the "x11" check happens implicitly as window->frame != NULL, maybe do it explicitly so it's clearer?
Comment 7 Carlos Garnacho 2016-10-12 17:15:00 UTC
Comment on attachment 336134 [details] [review]
wayland/pointer-constraints: Disable or remove when grab is cancelled

I missed that there's no addition of the cancel method in the grab vtable, nor callers of this method, is this perhaps in another bug?
Comment 8 Carlos Garnacho 2016-10-12 17:32:59 UTC
Comment on attachment 336134 [details] [review]
wayland/pointer-constraints: Disable or remove when grab is cancelled

Please ignore me, I see it's already in master.
Comment 9 Jonas Ådahl 2016-10-13 05:03:41 UTC
Pushed with the rename as suggested, and an extra g_assert (is-wayland-surface) in the frame intersection path to make it obvious this is about Xwayland. I didn't add any extra documentation about Xwayland related rules, since there already is a comment explaining that.

Attachment 336134 [details] pushed as 7ae4b28 - wayland/pointer-constraints: Disable or remove when grab is cancelled
Attachment 336135 [details] pushed as 6cc8450 - wayland/pointer-constraints: Unify requirements for enablement
Attachment 336136 [details] pushed as 6480a7e - wayland/pointer-constraints: Don't include window frame in region