-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Pointer warp issue in World of Warcraft after commit 6ea4539 #5405
Comments
Thanks for reporting this. I'm assuming what's going on under the hood is Xwayland sets up a I don't think this actually contradicts the spec as written, which says: When unlocking, the compositor may warp the cursor position to the set
cursor position hint. If it does, it will not result in any relative
motion events emitted via wp_relative_pointer. Sway doesn't send a I think the spirit of that paragraph in the spec is to prevent the sort of jumps you're seeing, though, so it seems reasonable to me that we shouldn't emit any motion events in that case — not just relative ones. I'll see if we can get some extra clarification on what a compositor should do in this case. |
@Xyene Can you create a wayland-protocols issue about this? |
I believe I have a related issue in Team Fortress 2. The cursor is normally locked to the center of the screen (it's a first person game) but occasionally it will jump down, pointing my view directly to the ground. After reverting |
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.
Thanks for testing @nivekuil! |
So after some more days of testing, I've occasionally seen the behavior repeat. It's much less frequent than before but I think the patch must be missing some fundamental behavior. It's kind of tricky to reproduce: the most reliable way to reproduce has been to switch between workspaces with captured-mouse games and wave the mouse around while clicking. When the cursor does go into the "warping" state, switching to another window and back doesn't fix it, while switching to another window and then clicking does. |
To narrow things down, if you comment out just this line, does the issue still occur?
What do you mean by "warping state"? I think our terminology doesn't match here, because I don't understand what you mean in that sentence :) The two cases where Sway post-6ea4539 emits a motion event where it didn't before are:
If the game lost focus and decided to create a new constraint upon regaining focus and this resulted in a warp, we should be sending a motion event there. You should be able to verify what the game is doing by inspecting Sway logs; there'll be messages about new locked pointers in there. |
Is this the same issue as #4632? |
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.
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.
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.
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.
Fixes camera re-centering issue with games like FFXIV or WoW on XWayland. See swaywm#5405 Closes swaywm#4632
Fixes camera re-centering issue with games like FFXIV or WoW on XWayland. See swaywm#5405 Closes swaywm#4632
Losing the precision resulted in wlr_cursor and wlr_seat::pointer_state getting out of sync during pointer motion in seatop_down. Since the difference was always under 1 px, it was practically impossible to notice in normal use. But because of being out of sync, cursor_rebase would always end up incorrectly calling wlr_seat_pointer_notify_motion from seatop_default_begin (on releasing mouse button) which broke cursor locking. See swaywm#5405 Closes swaywm#4632
Losing the precision resulted in wlr_cursor and wlr_seat::pointer_state getting out of sync during pointer motion in seatop_down. Since the difference was always under 1 px, it was practically impossible to notice in normal use. But because of being out of sync, cursor_rebase would always end up incorrectly calling wlr_seat_pointer_notify_motion from seatop_default_begin (on releasing mouse button) which broke cursor locking. See #5405 Closes #4632
Losing the precision resulted in wlr_cursor and wlr_seat::pointer_state getting out of sync during pointer motion in seatop_down. Since the difference was always under 1 px, it was practically impossible to notice in normal use. But because of being out of sync, cursor_rebase would always end up incorrectly calling wlr_seat_pointer_notify_motion from seatop_default_begin (on releasing mouse button) which broke cursor locking. See swaywm#5405 Closes swaywm#4632
The behaviour change with pointer warping in commit 6ea4539 causes issues with World of Warcraft's use of warp. Now, the game is already a little odd with pointer warp and at the moment requires an Xwayland patch to function as it does in X11: https://gitlab.freedesktop.org/xorg/xserver/-/issues/734 . In the game, holding the right mouse button hides and warps the cursor to center and starts rotating the camera. Releasing right mouse button shows the cursor, warps it back to start and disables camera rotation. With the change in commit 6ea4539 the camera is jumping when releasing the right mouse button. My assumption is that because the warp back now causes an event, it is still taken as camera movement.
I'm a little unsure where this issue should be directed to. Under X11 everything works so the issue is in wine -> Xwayland -> sway. The breaking change is in sway, but it seems the change was made to conform to spec. The game itself is non-free and as this has been the behaviour for decades it is unlikely to change. The example program in Xwayland issue 734 shows the behaviour when the motion event print is uncommented. The position change on the first 2 motion events after button release is large.
The text was updated successfully, but these errors were encountered: