-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Menu window size is erroneously clamped to main viewport size #7730
Labels
Comments
This issue has been introduced in the 1.90.3 |
ocornut
changed the title
Cropped popup/context from a menu
Menu window size is erroneously clamped to main viewport size
Jun 24, 2024
I think the fix may be to use: const bool is_child_not_popup = (window->Flags & ImGuiWindowFlags_ChildWindow) && !(window->Flags & ImGuiWindowFlags_Popup);
ImVec2 size_min = CalcWindowMinSize(window);
ImVec2 size_max = (window->ViewportOwned || is_child_not_popup) ? ImVec2(FLT_MAX, FLT_MAX) : ImGui::GetMainViewport()->WorkSize - style.DisplaySafeAreaPadding * 2.0f;
const int monitor_idx = window->ViewportAllowPlatformMonitorExtend;
if (monitor_idx >= 0 && monitor_idx < g.PlatformIO.Monitors.Size && !is_child_not_popup)
size_max = g.PlatformIO.Monitors[monitor_idx].WorkSize - style.DisplaySafeAreaPadding * 2.0f; But I would need to add more tests for the past cases were stumbled into before validating this is good. It's currently too complex/subtle to understand the reasons behind that logic. |
Should be fixed by a028c2d. Thanks for reporting! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version/Branch of Dear ImGui:
Version 1.90.8, Branch: docking
Back-ends:
imgui_impl_win32.cpp + imgui_impl_dx12.cpp
Compiler, OS:
Windows 10 + MSVC 2022
Full config/build information:
Details:
Hi!
There is an issue related only to the docking branch with the function CalcWindowAutoFitSize
It's always using the main viewport to define the size_max in some cases. One at least is happening here:
Thank you!
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: