-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Mouse is janky, especially while window is unfocused #7294
Description
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.