-
-
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
Child-menus no longer attempt to fit inside the viewport #7287
Comments
Was this mis-triaged as multi-viewports? I feel like my title could have been misleading. What I really meant was "child-menus no longer attempt to fit inside the work rect of the viewport" My very temporary fix is this: (master only) Index: imgui.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/imgui.cpp b/imgui.cpp
--- a/imgui.cpp (revision 536090303a8fca7d896f77d6d63dc59249bc87f4)
+++ b/imgui.cpp (date 1707564068063)
@@ -5755,7 +5755,8 @@
{
// Maximum window size is determined by the viewport size or monitor size
ImVec2 size_min = CalcWindowMinSize(window);
- ImVec2 size_max = (window->Flags & ImGuiWindowFlags_ChildWindow) ? ImVec2(FLT_MAX, FLT_MAX) : ImGui::GetMainViewport()->WorkSize - style.DisplaySafeAreaPadding * 2.0f;
+ ImVec2 size_max = (window->Flags & ImGuiWindowFlags_ChildWindow && !(window->Flags & ImGuiWindowFlags_ChildMenu)) ?
+ ImVec2(FLT_MAX, FLT_MAX) : ImGui::GetMainViewport()->WorkSize - style.DisplaySafeAreaPadding * 2.0f;
ImVec2 size_auto_fit = ImClamp(size_desired, size_min, size_max);
// When the window cannot fit all contents (either because of constraints, either because screen is too small), |
You are right, I've pushed the fix 3af739a. if (ImGui::Button("OpenPopup"))
ImGui::OpenPopup("Popup");
if (ImGui::BeginPopup("Popup", ImGuiWindowFlags_ChildWindow))
{
for (int i = 0; i < 50; ++i)
{
ImGui::Text("hello!");
}
ImGui::EndPopup();
} Using Popup+Child flags together is not well documented behavior but as various uses. |
Version/Branch of Dear ImGui:
Version 1.90.2 WIP (19016), Branch: master
Back-ends:
imgui_impl_win32.cpp + imgui_impl_dx11.cpp
Compiler, OS:
Windows 10 + MSVC
Full config/build information:
Details:
My Issue/Question:
As of 1.90.1 child menus no longer attempt to fit inside of the viewport. Root menus still work correctly.
Introduced in commit f37f6f6 (Related issue: #7063)
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
Can also be seen on the demo submenus (e.g Menu->Colors)
The text was updated successfully, but these errors were encountered: