diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 3ab3774ce182..77a414818c04 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -99,16 +99,6 @@ Other changes: Note that Linux/Mac still have inconsistent support for multi-viewports. If you want to help see https://github.com/ocornut/imgui/issues/2117. ------------------------------------------------------------------------ - VERSION 1.86 WIP (In Progress) ------------------------------------------------------------------------ - -Docking+Viewports Branch: - -- Docking: Revert removal of io.ConfigDockingWithShift config option (removed in 1.83). (#4643) -- Backends: Made it possible to shutdown default Platform Backends before the Renderer backends. (#4656) - - ----------------------------------------------------------------------- VERSION 1.86 WIP (In Progress) ----------------------------------------------------------------------- @@ -154,9 +144,12 @@ Other Changes: Docking+Viewports Branch: +- Docking: Revert removal of io.ConfigDockingWithShift config option (removed in 1.83). (#4643) - Viewports: Made it possible to explicitly assign ImGuiWindowClass::ParentViewportId to 0 in order to ensure a window is not parented. Previously this would use the global default (which might be 0, but not always as it would depend on io.ConfigViewportsNoDefaultParent). (#3152, #2871) +- Viewports: Fixed tooltip in own viewport over modal from being incorrectly dimmed. (#4729) +- Backends: Made it possible to shutdown default Platform Backends before the Renderer backends. (#4656) - Disabled: Fixed nested BeginDisabled()/EndDisabled() bug in Docking branch due to bad merge. (#4655, #4452, #4453, #4462) diff --git a/imgui.cpp b/imgui.cpp index 730a6a8758d5..87c2bbfec0f7 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4534,11 +4534,15 @@ static void AddWindowToDrawData(ImGuiWindow* window, int layer) } } +static inline int GetWindowDisplayLayer(ImGuiWindow* window) +{ + return (window->Flags & ImGuiWindowFlags_Tooltip) ? 1 : 0; +} + // Layer is locked for the root window, however child windows may use a different viewport (e.g. extruding menu) -static void AddRootWindowToDrawData(ImGuiWindow* window) +static inline void AddRootWindowToDrawData(ImGuiWindow* window) { - int layer = (window->Flags & ImGuiWindowFlags_Tooltip) ? 1 : 0; - AddWindowToDrawData(window, layer); + AddWindowToDrawData(window, GetWindowDisplayLayer(window)); } void ImDrawDataBuilder::FlattenIntoSingleLayer() @@ -7303,6 +7307,12 @@ bool ImGui::IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent, bool ImGui::IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_below) { ImGuiContext& g = *GImGui; + + // It would be saner to ensure that display layer is always reflected in the g.Windows[] order, which would likely requires altering all manipulations of that array + const int display_layer_delta = GetWindowDisplayLayer(potential_above) - GetWindowDisplayLayer(potential_below); + if (display_layer_delta != 0) + return display_layer_delta > 0; + for (int i = g.Windows.Size - 1; i >= 0; i--) { ImGuiWindow* candidate_window = g.Windows[i];