Description
Calling Window::set_cursor_visible hides or shows the cursor. On Linux Wayland (GNOME 42) though, this doesn't work once you've clicked the window (at least) once.
Demo code
I've composed a demo to reproduce it here: https://git.sr.ht/~tobtobxx/winit-wayland-mouse-demo
Behavior
- Compile & Run this code.
- Correct behaviour: C hides and shows the cursor.
- Click anywhare inside the window.
- Incorrect behaviour: C doesn't work anymore.
- Moving the mouse outside the window restores the correct behaviour.
(the hotkey C just toggles the call to set_cursor_visible: source.)
References
I first stumbled across this in veloren. It is reported there too: Veloren, issue #1464