diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 630a1d81..a979cc8a 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -138,6 +138,7 @@ Other Changes: - Tabs: Enforcing minimum size of 1.0f, fixed asserting on zero-tab widths. (#5572) - Window: Fixed a potential crash when appending to a child window. (#5515, #3496, #4797) [@rokups] - Window: Fixed an issue where uncollapsed a window would show a scrollbar for a frame. +- Window: Auto-fit size takes account of work rectangle (menu bars eating from viewport). (#5843) - IO: Added ImGuiMod_Shortcut which is ImGuiMod_Super on Mac and ImGuiMod_Ctrl otherwise. (#456) - IO: Added ImGuiKey_MouseXXX aliases for mouse buttons/wheel so all operations done on ImGuiKey can apply to mouse data as well. (#4921) diff --git a/imgui.cpp b/imgui.cpp index d5486d64..305a8030 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5732,8 +5732,7 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont if (is_popup || is_menu) // Popups and menus bypass style.WindowMinSize by default, but we give then a non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups) size_min = ImMin(size_min, ImVec2(4.0f, 4.0f)); - // FIXME-VIEWPORT-WORKAREA: May want to use GetWorkSize() instead of Size depending on the type of windows? - ImVec2 avail_size = ImGui::GetMainViewport()->Size; + ImVec2 avail_size = ImGui::GetMainViewport()->WorkSize; ImVec2 size_auto_fit = ImClamp(size_desired, size_min, ImMax(size_min, avail_size - style.DisplaySafeAreaPadding * 2.0f)); // When the window cannot fit all contents (either because of constraints, either because screen is too small), diff --git a/imgui.h b/imgui.h index 5ae2158c..8fa9a65a 100644 --- a/imgui.h +++ b/imgui.h @@ -23,7 +23,7 @@ // Library Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345') #define IMGUI_VERSION "1.89 WIP" -#define IMGUI_VERSION_NUM 18833 +#define IMGUI_VERSION_NUM 18834 #define IMGUI_HAS_TABLE /*