-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
close_on_esc
does nothing if window was immediately focused on creation
#5646
Comments
This might be related to IntelliJ. When I start my game from the terminal instead, there seems to always be an initial EDIT: Actually I was able to reproduce the no initial |
As far as I can tell, this must be a winit bug/issue. A search in winit's docs for 'focus' suggest that it doesn't expose any other way for getting window focus. Alternatively, your window manager is lying to your programs about their focus state. |
This sounds like correct behaviour, only the focused window should be able to read keyboard input. You can configure i3 to focus a window on creation though.
|
The behavior is that |
This reminded me of some changes I've got stashed from a couple months ago that would fix this. I'll probably have the PR up in a bit :) |
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 <[email protected]>
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 <[email protected]>
If you figure out a way to reliably reproduce this let me know, It hasn't happened to me yet in i3 after months of use with bevy. |
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Can be closed as obsolete after #12859. |
Ok I switched accounts lol closing this myself |
bevy/crates/bevy_window/src/system.rs
Line 46 in 5595733
On Linux with i3 WM, sometimes the app window will be focused on creation with no initial
WindowFocused
event. When this happens,close_on_esc
does nothing until you unfocus and refocus the window to send aWindowFocused
event.The text was updated successfully, but these errors were encountered: