From 00abd2c3253dfce78fc8dc4acca7223134d5650d Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 1 Jun 2026 16:21:30 +0200 Subject: [PATCH] Viewports: fixed an issue where the implicit "Debug" window while hidden would erroneously interfere with merging secondary viewports into the main viewport. --- docs/CHANGELOG.txt | 6 +++++- imgui.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 4d37daa60..275da0680 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -68,6 +68,10 @@ Other Changes: Docking+Viewports Branch: +- Viewports: + - Fixed an issue where the implicit "Debug" window while hidden would erroneously + interfere with merging secondary viewports into the main viewport. + ----------------------------------------------------------------------- VERSION 1.92.8 (Released 2026-05-12) @@ -450,7 +454,7 @@ Docking+Viewports Branch: - Viewports: - Fixed an issue where the implicit "Debug" window would erroneously be targetted for mouse inputs while hidden if (1) the implicit "Debug" window was used in a previous - session and moved to a secondary viewport and (2) the Platform Backend does not + session and moved to a secondary viewport and (2) the Platform Backend does not support the `ImGuiBackendFlags_HasMouseHoveredViewport` feature. (#9254) - Backends: SDL2, SDL3: fixed an issue dated 2025/04/09 (1.92 WIP) where a refactor and a merge caused `ImGuiBackendFlags_HasMouseHoveredViewport` to never be set, causing diff --git a/imgui.cpp b/imgui.cpp index 98f04fe6b..c3e077023 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -16781,7 +16781,7 @@ static bool ImGui::UpdateTryMergeWindowIntoHostViewport(ImGuiWindow* window, ImG for (ImGuiViewportP* viewport_obstructing : g.Viewports) { - if (viewport_obstructing == viewport_src || viewport_obstructing == viewport_dst) + if (viewport_obstructing == viewport_src || viewport_obstructing == viewport_dst || !viewport_obstructing->PlatformWindowCreated) continue; if (viewport_obstructing->GetMainRect().Overlaps(window->Rect())) if (IsViewportAbove(viewport_obstructing, viewport_dst))