-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Add Windows::get_focused(_mut)
#6571
Conversation
I'd not looked into this before. Surely assuming that every window is focused on creation also doesn't make sense. E.g. on systems where new windows don't get focus automatically Something else needs to change here, I think. We need winit to provide some guidance here. So this is still an improvement, but I think this is unviable as an end state |
Thanks for pointing that out. I had thought that I've changed .add_system(|windows: Res<Windows>| {
println!("{}", windows.iter().filter(|w| w.is_focused()).count())
}) |
There is the possibility that a rogue Window 'unfocused' event is getting in there (e.g. |
Surely that would be considered a bug in the window manager? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this now
bors r+ |
Add a method to get the focused window. Use this instead of `WindowFocused` events in `close_on_esc`. Seems that the OS/window manager might not always send focused events on application startup. Sadly, not a fix for #5646. Co-authored-by: devil-ira <justthecooldude@gmail.com>
Build failed (retrying...): |
Add a method to get the focused window. Use this instead of `WindowFocused` events in `close_on_esc`. Seems that the OS/window manager might not always send focused events on application startup. Sadly, not a fix for #5646. Co-authored-by: devil-ira <justthecooldude@gmail.com>
Windows::get_focused(_mut)
Windows::get_focused(_mut)
Add a method to get the focused window. Use this instead of `WindowFocused` events in `close_on_esc`. Seems that the OS/window manager might not always send focused events on application startup. Sadly, not a fix for bevyengine#5646. Co-authored-by: devil-ira <justthecooldude@gmail.com>
Add a method to get the focused window. Use this instead of `WindowFocused` events in `close_on_esc`. Seems that the OS/window manager might not always send focused events on application startup. Sadly, not a fix for bevyengine#5646. Co-authored-by: devil-ira <justthecooldude@gmail.com>
Add a method to get the focused window. Use this instead of `WindowFocused` events in `close_on_esc`. Seems that the OS/window manager might not always send focused events on application startup. Sadly, not a fix for bevyengine#5646. Co-authored-by: devil-ira <justthecooldude@gmail.com>
Add a method to get the focused window.
Use this instead of
WindowFocused
events inclose_on_esc
.Seems that the OS/window manager might not always send focused events on application startup.
Sadly, not a fix for #5646.