Skip to content

Mouse is janky, especially while window is unfocused #7294

@rparrett

Description

@rparrett

Bevy version

ddfafab is the first bad commit

System Information

AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
SystemInfo { os: "MacOS 13.1 ", kernel: "22.2.0", cpu: "Apple M1 Max", core_count: "10", memory: "64.0 GiB" }

macbook touchpad

What you did

  • cargo run --example sprite [--release]
  • focus another window
  • move mouse over bevy window.

What went wrong

With the window unfocused, it is very difficult for the mouse to escape from the window

Mouse sluggishness is also noticeable when the window is focused. On macos this also presents itself as the "cursor enlargement" effect that happens when you rapidly shake the mouse.

Additional information

I believe that the "bevy window"'s cursor position is getting updated by winit but then feeding back into winit.
Relevant code: https://github.com/bevyengine/bevy/blob/main/crates/bevy_winit/src/system.rs#L173
I haven't been able to completely prove that theory just yet, but commenting out that line of code fixes the symptoms for me.

Tracy says that we're spending an awful lot of time in that system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-InputPlayer input via keyboard, mouse, gamepad, and moreA-WindowingPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions