Docking: Fixed moving window being interrupted when undocing a window with "io.ConfigDockingAlwaysTabBar = true". (#5324)

Regression introduced in 6b7766817
This commit is contained in:
Rokas Kupstys 2022-05-19 14:01:18 +03:00 committed by ocornut
parent 6b5a2426d7
commit 36055213c5
2 changed files with 4 additions and 2 deletions

View File

@ -188,7 +188,9 @@ Other Changes:
Docking+Viewports Branch:
- Docking: Fixed floating docked nodes not being clamped into viewport workrect to stay reachable
when g.ConfigWindowsMoveFromTitleBarOnly is set and multi-viewports are disabled. (#5044)
when io.ConfigWindowsMoveFromTitleBarOnly is true and multi-viewports are disabled. (#5044)
- Docking: Fixed a regression where moving window would be interrupted after undocking a tab
when io.ConfigDockingAlwaysTabBar is true. (#5324) [@rokups]
- Viewports: Fixed translating a host viewport from briefly altering the size of AlwaysAutoResize windows. (#5057)
- Viewports: Fixed main viewport size not matching ImDrawData::DisplaySize for one frame during resize
when multi-viewports are disabled. (#4900)

View File

@ -3936,7 +3936,7 @@ void ImGui::UpdateMouseMovingWindowNewFrame()
ImGuiWindow* moving_window = g.MovingWindow->RootWindowDockTree;
// When a window stop being submitted while being dragged, it may will its viewport until next Begin()
const bool window_disappared = (!moving_window->WasActive || moving_window->Viewport == NULL);
const bool window_disappared = ((!moving_window->WasActive && !moving_window->Active) || moving_window->Viewport == NULL);
if (g.IO.MouseDown[0] && IsMousePosValid(&g.IO.MousePos) && !window_disappared)
{
ImVec2 pos = g.IO.MousePos - g.ActiveIdClickOffset;