You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Called the Window.cursor_positionmethod after moving mouse from one window to another.
What went wrong
It intermittently returns Some(...) when it should be None.
Additional information
Using the small app below, this video shows the issue clearly. You can see that sometimes, but not always, when moving the cursor from one window directly to another window, the first window still thinks it has the cursor. This results in multiple windows claiming they have the cursor, while only one can at any one time.
I can see here Bevy sets the cursor position to None when it sees a WindowEvent::CursorLeft event from winit, but I verified that it is fired every time, even when the issue occurs, so I don't believe this is a bug in winit.
Screen.Recording.2023-06-14.at.7.26.15.pm.mov
Minimal app:
use bevy::prelude::*;fnmain(){App::new().add_plugins(DefaultPlugins.set(WindowPlugin{primary_window:Some(Window{position:WindowPosition::At(IVec2::new(400,200)),
..default()}),
..default()})).add_startup_system(setup).add_system(print_cursor_position).run();}fnsetup(mutcommands:Commands){
commands.spawn(Window{title:"Second window".to_owned(),position:WindowPosition::At(IVec2::new(0,0)),
..default()});}fnprint_cursor_position(windows_q:Query<&Window>){for window in windows_q.iter(){println!("Window '{}' cursor position: {:?}",
window.title,
window.cursor_position());}}
Bevy version
0.10.1
What you did
Called the
Window.cursor_positionmethod after moving mouse from one window to another.What went wrong
It intermittently returns
Some(...)when it should beNone.Additional information
Using the small app below, this video shows the issue clearly. You can see that sometimes, but not always, when moving the cursor from one window directly to another window, the first window still thinks it has the cursor. This results in multiple windows claiming they have the cursor, while only one can at any one time.
I can see here Bevy sets the cursor position to
Nonewhen it sees aWindowEvent::CursorLeftevent from winit, but I verified that it is fired every time, even when the issue occurs, so I don't believe this is a bug in winit.Screen.Recording.2023-06-14.at.7.26.15.pm.mov
Minimal app: