mirror of
https://github.com/ocornut/imgui.git
synced 2026-06-02 11:06:51 +08:00
Viewports, Docking: Fixed a bug where closing a viewport using OS facilities would erroneously close all windows located in the viewport. (#8887)
This commit is contained in:
@@ -70,6 +70,12 @@ Changes:
|
|||||||
- Backends: Allegro5: Fixed missing support for ImGuiKey_PrintScreen
|
- Backends: Allegro5: Fixed missing support for ImGuiKey_PrintScreen
|
||||||
under Windows, as raw Allegro 5 does not receive it.
|
under Windows, as raw Allegro 5 does not receive it.
|
||||||
|
|
||||||
|
Docking+Viewports Branch:
|
||||||
|
|
||||||
|
- Fixed a bug where closing a viewport using OS facility (e.g. ALT+F4, Close Button)
|
||||||
|
would erroneously close all windows located in the viewport, even ones docked
|
||||||
|
into nested dockspaces. Only top-most windows should be closed. (#8887) [@lailoken]
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
VERSION 1.92.2 (Released 2025-08-11)
|
VERSION 1.92.2 (Released 2025-08-11)
|
||||||
|
|||||||
@@ -8373,7 +8373,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||||||
NavInitWindow(window, false); // <-- this is in the way for us to be able to defer and sort reappearing FocusWindow() calls
|
NavInitWindow(window, false); // <-- this is in the way for us to be able to defer and sort reappearing FocusWindow() calls
|
||||||
|
|
||||||
// Close requested by platform window (apply to all windows in this viewport)
|
// Close requested by platform window (apply to all windows in this viewport)
|
||||||
|
// FIXME: Investigate removing the 'window->Viewport != GetMainViewport()' test, which seems superfluous.
|
||||||
if (p_open != NULL && window->Viewport->PlatformRequestClose && window->Viewport != GetMainViewport())
|
if (p_open != NULL && window->Viewport->PlatformRequestClose && window->Viewport != GetMainViewport())
|
||||||
|
if (window->DockNode == NULL || (window->DockNode->MergedFlags & ImGuiDockNodeFlags_DockSpace) == 0)
|
||||||
{
|
{
|
||||||
IMGUI_DEBUG_LOG_VIEWPORT("[viewport] Window '%s' closed by PlatformRequestClose\n", window->Name);
|
IMGUI_DEBUG_LOG_VIEWPORT("[viewport] Window '%s' closed by PlatformRequestClose\n", window->Name);
|
||||||
*p_open = false;
|
*p_open = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user