diff --git a/src/frame/opengl/gui/sdl_opengl_draw_gui.cpp b/src/frame/opengl/gui/sdl_opengl_draw_gui.cpp index 33af66b..ce09d51 100644 --- a/src/frame/opengl/gui/sdl_opengl_draw_gui.cpp +++ b/src/frame/opengl/gui/sdl_opengl_draw_gui.cpp @@ -182,9 +182,7 @@ bool SDL2OpenGLDrawGui::Update(DeviceInterface& device, double dt) } } // Check if you should enable default window keyboard and mouse. - if (ImGui::IsWindowHovered() && - is_default_output && - !is_keyboard_passed_locked_) + if (ImGui::IsWindowHovered() && is_default_output ) { is_keyboard_passed_ = true; } @@ -288,7 +286,9 @@ bool SDL2OpenGLDrawGui::PollEvent(void* event) if (is_keyboard_passed_) return false; auto& io = ImGui::GetIO(); - return io.WantCaptureMouse || io.WantCaptureKeyboard; + return (is_keyboard_passed_locked_) + ? io.WantCaptureMouse || io.WantCaptureKeyboard + : false; } frame::gui::GuiWindowInterface& SDL2OpenGLDrawGui::GetWindow(