Browse Source

Docking: fixed using ImGuiDockNodeFlags_KeepAliveOnly with DockSpaceOverViewport(). (#8125)

ocornut 9 months ago
parent
commit
a63220e3e0
2 changed files with 12 additions and 0 deletions
  1. 7 0
      docs/CHANGELOG.txt
  2. 5 0
      imgui.cpp

+ 7 - 0
docs/CHANGELOG.txt

@@ -53,6 +53,13 @@ Other changes:
   by 100.0f on Emscripten target. (#4019, #6096, #1463)
   by 100.0f on Emscripten target. (#4019, #6096, #1463)
 - Examples: Added SDL3+Vulkan example. (#8084, #8085)
 - Examples: Added SDL3+Vulkan example. (#8084, #8085)
 
 
+Docking+Viewports Branch:
+
+- Docking: fixed using ImGuiDockNodeFlags_KeepAliveOnly with DockSpaceOverViewport():
+  the normally invisible space did erroneously claim mouse hover and could be potentially
+  focused. (#8125) [@kcbanner]
+
+
 -----------------------------------------------------------------------
 -----------------------------------------------------------------------
  VERSION 1.91.4 (Released 2024-10-18)
  VERSION 1.91.4 (Released 2024-10-18)
 -----------------------------------------------------------------------
 -----------------------------------------------------------------------

+ 5 - 0
imgui.cpp

@@ -19542,6 +19542,11 @@ ImGuiID ImGui::DockSpaceOverViewport(ImGuiID dockspace_id, const ImGuiViewport*
     if (dockspace_flags & ImGuiDockNodeFlags_PassthruCentralNode)
     if (dockspace_flags & ImGuiDockNodeFlags_PassthruCentralNode)
         host_window_flags |= ImGuiWindowFlags_NoBackground;
         host_window_flags |= ImGuiWindowFlags_NoBackground;
 
 
+    // FIXME-OPT: When using ImGuiDockNodeFlags_KeepAliveOnly with DockSpaceOverViewport() we might be able to spare submitting the window,
+    // since DockSpace() with that flag doesn't need a window. We'd only need to compute the default ID accordingly.
+    if (dockspace_flags & ImGuiDockNodeFlags_KeepAliveOnly)
+        host_window_flags |= ImGuiWindowFlags_NoMouseInputs;
+
     char label[32];
     char label[32];
     ImFormatString(label, IM_ARRAYSIZE(label), "WindowOverViewport_%08X", viewport->ID);
     ImFormatString(label, IM_ARRAYSIZE(label), "WindowOverViewport_%08X", viewport->ID);