jakobhellermann / bevy_editor_pls

In-App editor tools for bevy applications
Other
758 stars 78 forks source link

Editor when in another window inconsistently responds to inputs from other windows #78

Open Architector4 opened 1 year ago

Architector4 commented 1 year ago

I'm adding this editor by slapping it on the Bevy app like so:

        .add_plugin(EditorPlugin::new().in_new_window(Window::default()))

However, the viewport window in the editor, as well as keyboard shortcuts like T/R/S, seem to sometimes respond to mouse and keyboard events from the primary window, when the editor window is not in focus.

From experimentation, it seems like the most consistent way to trigger this bug is to put one window over the other and quickly move the mouse from the editor window to the primary window, where the cursor is over one of the two Bevy's windows for every frame, and then try the inputs.

I assume the input code there isn't checking if the window the editor is on is actually in focus before processing input events or something?