From 86fce79a6c23fe6cf0caaee1aa1e3ba47ace0d05 Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 22 Jan 2019 17:09:14 +0100 Subject: [PATCH] Comments + clear out VisibleWinodw field (should have no effect) --- imgui.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index f943b7d0c..0b7dd3f5d 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3164,7 +3164,7 @@ void ImGui::StartMouseMovingWindow(ImGuiWindow* window) { // Set ActiveId even if the _NoMove flag is set. Without it, dragging away from a window with _NoMove would activate hover on other windows. // We _also_ call this when clicking in a window empty space when io.ConfigWindowsMoveFromTitleBarOnly is set, but clear g.MovingWindow afterward. - // This is because we want ActiveId to be set even when the window is stuck from moving. + // This is because we want ActiveId to be set even when the window is not permitted to move. ImGuiContext& g = *GImGui; FocusWindow(window); SetActiveID(window->MoveId, window); @@ -3252,7 +3252,8 @@ void ImGui::UpdateMouseMovingWindowEndFrame() } else if (g.NavWindow != NULL && GetFrontMostPopupModal() == NULL) { - FocusWindow(NULL); // Clicking on void disable focus + // Clicking on void disable focus + FocusWindow(NULL); } } @@ -5598,6 +5599,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) } // Draw window + handle manual resize + // As we highlight the title bar when want_focus is set, multiple reappearing windows will have have their title bar highlighted on their reappearing frame. const float window_rounding = window->WindowRounding; const float window_border_size = window->WindowBorderSize; const ImGuiWindow* window_to_highlight = g.NavWindowingTarget ? g.NavWindowingTarget : g.NavWindow; @@ -10796,6 +10798,8 @@ static void ImGui::DockNodeRemoveWindow(ImGuiDockNode* node, ImGuiWindow* window break; } IM_ASSERT(erased); + if (node->VisibleWindow == window) + node->VisibleWindow = NULL; // Remove tab and possibly tab bar if (node->TabBar)