From 46698c96c58b3878d4f4e63e08c2ec606a069b2e Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 24 Apr 2018 16:48:26 +0200 Subject: [PATCH] Removed presumably obsolete MovingWindow tests which prevent move/merge logic in viewport branch from working in all situations (e.g. docking away when ActiveId is the ID of a tab) --- imgui.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index e8486912..31e96396 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3257,10 +3257,10 @@ static void ImGui::NavUpdate() static void ImGui::NewFrameUpdateMovingWindow() { ImGuiContext& g = *GImGui; - if (g.MovingWindow && g.MovingWindow->MoveId == g.ActiveId && g.ActiveIdSource == ImGuiInputSource_Mouse) + if (g.MovingWindow != NULL) { // We actually want to move the root window. g.MovingWindow == window we clicked on (could be a child window). - // We track it to preserve Focus and so that ActiveIdWindow == MovingWindow and ActiveId == MovingWindow->MoveId for consistency. + // We track it to preserve Focus and so that generally ActiveIdWindow == MovingWindow and ActiveId == MovingWindow->MoveId for consistency. KeepAliveID(g.ActiveId); IM_ASSERT(g.MovingWindow && g.MovingWindow->RootWindow); ImGuiWindow* moving_window = g.MovingWindow->RootWindow; @@ -3289,7 +3289,6 @@ static void ImGui::NewFrameUpdateMovingWindow() if (!g.IO.MouseDown[0]) ClearActiveID(); } - g.MovingWindow = NULL; } }