We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5492

Summary: [PATCH] Improve reliability of cursor hiding on GNOME Wayland
Product: SDL Reporter: Cameron Gutman <cameron.gutman>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: x86_64   
OS: Linux   
Attachments: Patch

Description Cameron Gutman 2021-01-22 04:50:24 UTC
Hiding the cursor doesn't appear to work reliably on GNOME when another window
steals mouse focus right as we call SDL_ShowCursor(SDL_DISABLE). This can happen
when the keyboard shortcut inhibition permission prompt appears in response to a
call to SDL_SetRelativeMouseMode() with SDL_HINT_GRAB_KEYBOARD=1. The result is
that the default cursor is stuck locked in position and visible on screen
indefinitely.

By redrawing the cursor on pointer focus enter, the cursor now disappears upon
the first mouse motion event. It's not perfect but it's way better than the
current behavior.
Comment 1 Cameron Gutman 2021-01-22 04:51:04 UTC
Created attachment 4685 [details]
Patch

Tested on GNOME 3.38.3
Comment 2 Sam Lantinga 2021-01-22 06:38:46 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/080f7cdf62a2