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 - [PATCH] Improve reliability of cursor hiding on GNOME Wayland
Summary: [PATCH] Improve reliability of cursor hiding on GNOME Wayland
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-22 04:50 UTC by Cameron Gutman
Modified: 2021-01-22 06:38 UTC (History)
0 users

See Also:


Attachments
Patch (1.55 KB, patch)
2021-01-22 04:51 UTC, Cameron Gutman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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