Docking: Fix undocking (#3243), amend 7b3d3798 (#1738)

This commit is contained in:
ocornut
2020-05-18 15:08:47 +02:00
parent 3b3af6b731
commit 615e9ae345
2 changed files with 14 additions and 4 deletions

View File

@ -7289,6 +7289,11 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
tab_bar->NextSelectedTabId = id;
hovered |= (g.HoveredId == id);
// Transfer active id window so the active id is not owned by the dock host (as StartMouseMovingWindow()
// will only do it on the drag). This allows FocusWindow() to be more conservative in how it clears active id.
if (held && docked_window && g.ActiveId == id && g.ActiveIdIsJustActivated)
g.ActiveIdWindow = docked_window;
// Allow the close button to overlap unless we are dragging (in which case we don't want any overlapping tabs to be hovered)
if (!held)
SetItemAllowOverlap();