Fix hiding cursor hiding on wayland#2274
Merged
kchibisov merged 1 commit intorust-windowing:masterfrom May 1, 2022
TobTobXX:master
Merged
Fix hiding cursor hiding on wayland#2274kchibisov merged 1 commit intorust-windowing:masterfrom TobTobXX:master
kchibisov merged 1 commit intorust-windowing:masterfrom
TobTobXX:master
Conversation
Contributor
Author
|
Oh, and also there's this test program, mentioned in the issues: https://git.sr.ht/~tobtobxx/winit-wayland-mouse-demo. It demonstrates hiding the cursor (with C) and dragging the window (both require sending the Wayland compositor the "latest" serial. Both should work now on all Wayland implementations). |
kchibisov
requested changes
May 1, 2022
Member
kchibisov
left a comment
There was a problem hiding this comment.
Looks good, should add a changelog entry that you've fixed issue on GNOME wrt cursor hiding.
Fixes #2273. The underlying method for hiding the cursor (setting its texuture to NULL) is wayland_client::protocol::wl_pointer::WlPointer::set_cursor(). This method expects a serial number of the last **enter** event. Right now, `latest_event` is any latest pointer event. It gets used by the call to set_cursor() and also to start_interactive_move(). While set_cursor() expects the latest enter event, start_interactive_move() expects the very latest serial from any event. Thus we need to track both. After this change, both serials are tracked and the appropriate is used in the call into smithay-client-toolkit. Tested on sway and gnome (on sway it already worked before the change).
kchibisov
approved these changes
May 1, 2022
Member
|
Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2273.
The underlying method for hiding the cursor (setting its texuture to
NULL) is
wayland_client::protocol::wl_pointer::WlPointer::set_cursor().This method expects a serial number of the last enter event.
Right now,
latest_eventis any latest pointer event. It gets used bythe call to
set_cursor()and also tostart_interactive_move(). Whileset_cursor()expects the latest enter event,start_interactive_move()expects the very latest serial from any event. Thus we need to track
both.
After this change, both serials are tracked and the appropriate is used
in the call into smithay-client-toolkit.
Tested on sway and gnome (on sway it already worked before the change).
See also #2273.
CHANGELOG.mdif knowledge of this change could be valuable to users none: bugfix