Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input/cursor: don't send wl_pointer.motion event on pointer unlock warp #5431

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

Xyene
Copy link
Member

@Xyene Xyene commented Jun 7, 2020

On warping to a cursor hint, update the pointer position we track as well, so that on the next pointer rebase we don't send an unexpected synthetic motion event to clients.

Fixes #5405.


Refs https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/20, awaiting clarification on that end but figured I should bring up a patch for testing/review earlier. I don't have any games/applications that require this patch, so it hasn't been tested by me (hoping to get someone affected by the issue to give it a shot).

If the plan is to tag Sway 1.5 in the near-ish future, I think we should either (temporarily) revert 6ea4539 or apply something along the lines of this patch. The slight cosmetic improvement 6ea4539 provides (+ making clicks post-swaymsg cursor move click the right location) is probably not worth breaking applications that rely on not seeing a motion event post-unlock.

(Tacking onto 1.5 milestone so that it doesn't get lost.)

@emersion
Copy link
Member

Hm, this writes into the internal seat state. I wonder if there's a better way to do this…

@Xyene
Copy link
Member Author

Xyene commented Jun 16, 2020

Yeah, I'm not a huge fan of poking into wlroots like this either. The fundamental problem is we do seem to need to be able to change that state without notifying clients of motion events (for this and #5459, at least), but knowledge of that state existing breaks the abstraction (as far as I can tell, it's just there as an optimization to prevent sending duplicate motion events).

Perhaps we could add wlr_seat_pointer_get_last_position and wlr_seat_pointer_warp to wlroots, and use those instead of directly poking wlroots?

@emersion
Copy link
Member

emersion commented Jul 2, 2020

+1 to wlr_seat_pointer_warp

Xyene added a commit to Xyene/wlroots that referenced this pull request Jul 3, 2020
These allow a compositor to do things like skip motion events on pointer
constraint unlock, or not move the pointer during touch emulation.

Refs swaywm/sway#5431, swaywm/sway#5459.
@Xyene Xyene force-pushed the no-motion-event-on-constraint-unlock branch from 280669d to 050c79e Compare July 3, 2020 05:59
Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

emersion pushed a commit to swaywm/wlroots that referenced this pull request Jul 15, 2020
It allows a compositor to do things like skip motion events on pointer
constraint unlock.

References: swaywm/sway#5431
@emersion emersion force-pushed the no-motion-event-on-constraint-unlock branch from 050c79e to 71cad7b Compare July 15, 2020 17:37
On warping to a cursor hint, update the pointer position we track as
well, so that on the next pointer rebase we don't send an unexpected
synthetic motion event to clients.

Fixes swaywm#5405.
@emersion emersion merged commit 6b9a9b6 into swaywm:master Jul 15, 2020
@emersion
Copy link
Member

Thanks!

@Xyene Xyene deleted the no-motion-event-on-constraint-unlock branch October 18, 2020 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Pointer warp issue in World of Warcraft after commit 6ea4539
2 participants