diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index f15ba372..63632159 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -98,6 +98,16 @@ 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.88 WIP (In Progress) +----------------------------------------------------------------------- + +Docking+Viewports Branch: + +- Viewports: Fixed main viewport size not matching ImDrawData::DisplaySize for one frame during resize + when multi-viewports are disabled. (#4900) + + ----------------------------------------------------------------------- VERSION 1.87 (Released 2022-02-07) ----------------------------------------------------------------------- diff --git a/imgui.cpp b/imgui.cpp index 5bc81335..44dc0c83 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -12903,9 +12903,10 @@ ImGuiViewportP* ImGui::AddUpdateViewport(ImGuiWindow* window, ImGuiID id, const ImGuiViewportP* viewport = (ImGuiViewportP*)FindViewportByID(id); if (viewport) { - if (!viewport->PlatformRequestMove) + // Always update for main viewport as we are already pulling correct platform pos/size (see #4900) + if (!viewport->PlatformRequestMove || viewport->ID == IMGUI_VIEWPORT_DEFAULT_ID) viewport->Pos = pos; - if (!viewport->PlatformRequestResize) + if (!viewport->PlatformRequestResize || viewport->ID == IMGUI_VIEWPORT_DEFAULT_ID) viewport->Size = size; viewport->Flags = flags | (viewport->Flags & ImGuiViewportFlags_Minimized); // Preserve existing flags }