diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index a11c8c12..9fd364eb 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -132,6 +132,8 @@ Other Changes: Docking+Viewports Branch: +- Docking: Fixed floating docked nodes not being clamped into viewport workrect to stay reachable + when g.ConfigWindowsMoveFromTitleBarOnly is set and multi-viewports are disabled. (#5044) - Viewports: Fixed main viewport size not matching ImDrawData::DisplaySize for one frame during resize when multi-viewports are disabled. (#4900) diff --git a/imgui.cpp b/imgui.cpp index 20774780..35c7c9ef 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6015,8 +6015,8 @@ static inline void ClampWindowRect(ImGuiWindow* window, const ImRect& visibility { ImGuiContext& g = *GImGui; ImVec2 size_for_clamping = window->Size; - if (g.IO.ConfigWindowsMoveFromTitleBarOnly && !(window->Flags & ImGuiWindowFlags_NoTitleBar)) - size_for_clamping.y = window->TitleBarHeight(); + if (g.IO.ConfigWindowsMoveFromTitleBarOnly && (!(window->Flags & ImGuiWindowFlags_NoTitleBar) || window->DockNodeAsHost)) + size_for_clamping.y = ImGui::GetFrameHeight(); // Not using window->TitleBarHeight() as DockNodeAsHost will report 0.0f here. window->Pos = ImClamp(window->Pos, visibility_rect.Min - size_for_clamping, visibility_rect.Max); }