From 3b07c9d4183552ba226c23fe0f6bd1f792979ce0 Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Fri, 17 Jan 2025 19:54:00 +0100 Subject: [PATCH] Proper fix for ImGui event passthrough --- src/imgui/renderer/imgui_core.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/imgui/renderer/imgui_core.cpp b/src/imgui/renderer/imgui_core.cpp index 46ef5058f..cd42d6aaa 100644 --- a/src/imgui/renderer/imgui_core.cpp +++ b/src/imgui/renderer/imgui_core.cpp @@ -33,6 +33,7 @@ static std::deque> change_layers{}; static std::mutex change_layers_mutex{}; static ImGuiID dock_id; +static ImGuiID game_window_id = 1054440878; namespace ImGui { @@ -141,9 +142,6 @@ void Shutdown(const vk::Device& device) { bool ProcessEvent(SDL_Event* event) { Sdl::ProcessEvent(event); - if (!DebugState.IsShowingDebugMenuBar()) { - return false; // temp workaround, only works if the debug menu is inactive - } switch (event->type) { // Don't block release/up events case SDL_EVENT_MOUSE_MOTION: @@ -151,7 +149,7 @@ bool ProcessEvent(SDL_Event* event) { case SDL_EVENT_MOUSE_BUTTON_DOWN: { const auto& io = GetIO(); return io.WantCaptureMouse && io.Ctx->NavWindow != nullptr && - io.Ctx->NavWindow->ID != dock_id; + (io.Ctx->NavWindow->Flags & ImGuiWindowFlags_NoNav) == 0; } case SDL_EVENT_TEXT_INPUT: case SDL_EVENT_KEY_DOWN: {