Skip to content

Wayland: Window::set_mouse_visible doesn't work when window was clicked. #2273

@TobTobXX

Description

@TobTobXX

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

  1. Compile & Run this code.
  2. Correct behaviour: C hides and shows the cursor.
  3. Click anywhare inside the window.
  4. Incorrect behaviour: C doesn't work anymore.
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions