Fix an issue with hide_cursor
and container focus
#8772
+1
−1
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.
This small patch fixes an issue with how
hide_cursor
feature interacts with keyboard control andwl_pointer.{enter,leave}
Wayland events. It seems to fix #6245.When the cursor is hidden over a container which regains focus without mouse warping (for example with keyboard bindings for
focus
andworkspace
commands whenmouse_warping
is set tooutput
), the Wayland eventwl_pointer.enter
is sent despite the cursor remaining hidden (and it is not reverted withwl_pointer.leave
). This is noticeable and somewhat bothersome in particular when using a web browser primarily with a keyboard — when the browser regains focus and a web site is scrolled with a keyboard, some hyperlinks become unexpectedly underlined (sometimes causing popups to appear, as on Wikipedia) because of the invisible cursor hovering above them, and getting rid of this behavior (for as long as the browser remains constantly focused) requires moving the cursor only to hide it again and send thewl_pointer.leave
event.This bug can be observed more precisely with wev, for example with these steps:
seat * hide_cursor 1000
.wev -f wl_pointer:enter -f wl_pointer:leave
.enter
andleave
events in wev output.enter
event in wev output.leave
event in wev output.The fix appears to be a simple check for
cursor->hidden
inhandle_rebase
(it works forhide_cursor when-typing
as well), but honestly I haven't overanalyzed this input system and can't say for sure if this is the best solution.