1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-09 23:54:20 +00:00

Fixed implicit/fallback "Debug" window from staying visible if once docked. (#9151)

This commit is contained in:
ocornut 2026-01-05 14:36:33 +01:00
parent 396b33d0d0
commit 00dfb3c896
2 changed files with 11 additions and 3 deletions

View file

@ -156,6 +156,7 @@ Docking+Viewports Branch:
- Fixed an assert in background dimming code, which could trigger after using
gamepad/keyboard to move a window to another viewport. (#9053) [@lut0pia, @ocornut]
- Fixed implicit/fallback "Debug" window from staying visible if once docked. (#9151)
- Backends:
- Win32: viewports created by backend forcefully direct messages to
DefWindowProcW() in order to support Unicode text input. (#9099, #3653, #5961) [@ulhc]

View file

@ -6201,7 +6201,7 @@ void ImGui::EndFrame()
// Hide implicit/fallback "Debug" window if it hasn't been used
g.WithinFrameScopeWithImplicitWindow = false;
if (g.CurrentWindow && !g.CurrentWindow->WriteAccessed)
if (g.CurrentWindow && g.CurrentWindow->IsFallbackWindow && g.CurrentWindow->WriteAccessed == false)
g.CurrentWindow->Active = false;
End();
@ -18698,7 +18698,7 @@ static void ImGui::DockNodeUpdateFlagsAndCollapse(ImGuiDockNode* node)
bool node_was_active = (node->LastFrameActive + 1 == g.FrameCount);
bool remove = false;
remove |= node_was_active && (window->LastFrameActive + 1 < g.FrameCount);
remove |= node_was_active && (window->WasActive == false); // Can't use 'window->LastFrameActive + 1 < g.FrameCount'. (see #9151)
remove |= node_was_active && (node->WantCloseAll || node->WantCloseTabId == window->TabId) && window->HasCloseButton && !(window->Flags & ImGuiWindowFlags_UnsavedDocument); // Submit all _expected_ closure from last frame
remove |= (window->DockTabWantClose);
if (remove)
@ -19405,7 +19405,7 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w
{
ImGuiWindow* window = node->Windows[window_n];
if (window->LastFrameActive + 1 < g.FrameCount && node_was_active)
continue; // FIXME: Not sure if that's still taken/useful.
continue; // FIXME: Not sure if that's still taken/useful, as windows are normally removed in DockNodeUpdateFlagsAndCollapse().
ImGuiTabItemFlags tab_item_flags = 0;
tab_item_flags |= window->WindowClass.TabItemFlagsOverrideSet;
@ -20994,6 +20994,13 @@ void ImGui::BeginDocked(ImGuiWindow* window, bool* p_open)
// Clear fields ahead so most early-out paths don't have to do it
window->DockIsActive = window->DockNodeIsVisible = window->DockTabIsVisible = false;
// Specific extra processing for fallback window (#9151), could be in Begin() as well.
if (window->IsFallbackWindow && !window->WasActive)
{
DockNodeHideWindowDuringHostWindowCreation(window);
return;
}
const bool auto_dock_node = GetWindowAlwaysWantOwnTabBar(window);
if (auto_dock_node)
{