mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Fixed implicit/fallback "Debug" window from staying visible if once docked. (#9151)
This commit is contained in:
parent
396b33d0d0
commit
00dfb3c896
2 changed files with 11 additions and 3 deletions
|
|
@ -156,6 +156,7 @@ Docking+Viewports Branch:
|
||||||
|
|
||||||
- Fixed an assert in background dimming code, which could trigger after using
|
- Fixed an assert in background dimming code, which could trigger after using
|
||||||
gamepad/keyboard to move a window to another viewport. (#9053) [@lut0pia, @ocornut]
|
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:
|
- Backends:
|
||||||
- Win32: viewports created by backend forcefully direct messages to
|
- Win32: viewports created by backend forcefully direct messages to
|
||||||
DefWindowProcW() in order to support Unicode text input. (#9099, #3653, #5961) [@ulhc]
|
DefWindowProcW() in order to support Unicode text input. (#9099, #3653, #5961) [@ulhc]
|
||||||
|
|
|
||||||
13
imgui.cpp
13
imgui.cpp
|
|
@ -6201,7 +6201,7 @@ void ImGui::EndFrame()
|
||||||
|
|
||||||
// Hide implicit/fallback "Debug" window if it hasn't been used
|
// Hide implicit/fallback "Debug" window if it hasn't been used
|
||||||
g.WithinFrameScopeWithImplicitWindow = false;
|
g.WithinFrameScopeWithImplicitWindow = false;
|
||||||
if (g.CurrentWindow && !g.CurrentWindow->WriteAccessed)
|
if (g.CurrentWindow && g.CurrentWindow->IsFallbackWindow && g.CurrentWindow->WriteAccessed == false)
|
||||||
g.CurrentWindow->Active = false;
|
g.CurrentWindow->Active = false;
|
||||||
End();
|
End();
|
||||||
|
|
||||||
|
|
@ -18698,7 +18698,7 @@ static void ImGui::DockNodeUpdateFlagsAndCollapse(ImGuiDockNode* node)
|
||||||
|
|
||||||
bool node_was_active = (node->LastFrameActive + 1 == g.FrameCount);
|
bool node_was_active = (node->LastFrameActive + 1 == g.FrameCount);
|
||||||
bool remove = false;
|
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 |= 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);
|
remove |= (window->DockTabWantClose);
|
||||||
if (remove)
|
if (remove)
|
||||||
|
|
@ -19405,7 +19405,7 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w
|
||||||
{
|
{
|
||||||
ImGuiWindow* window = node->Windows[window_n];
|
ImGuiWindow* window = node->Windows[window_n];
|
||||||
if (window->LastFrameActive + 1 < g.FrameCount && node_was_active)
|
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;
|
ImGuiTabItemFlags tab_item_flags = 0;
|
||||||
tab_item_flags |= window->WindowClass.TabItemFlagsOverrideSet;
|
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
|
// Clear fields ahead so most early-out paths don't have to do it
|
||||||
window->DockIsActive = window->DockNodeIsVisible = window->DockTabIsVisible = false;
|
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);
|
const bool auto_dock_node = GetWindowAlwaysWantOwnTabBar(window);
|
||||||
if (auto_dock_node)
|
if (auto_dock_node)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue