-
-
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
Opening popups with same name but non-conflicting local IDs breaks rendering #7327
Comments
In my opinion it's fairly confusing that popups effectively have two IDs like this. Dear ImGui is trying to concatenate the two windows but I'd argue this isn't ever what the user wants even without the rendering issue. (If the user really wanted this they'd concatenate by using As a related aside, I think it's somewhat unfortunate that I think a possible fix to both of these issues would be to introduce a new flag Since popup IDs are based on the current ID stack, they would always pass this flag to their inner This flag might also be helpful for (This whole thing came up organically while typing up an example for a suggestion on handling #7324 since I was supporting nested keybinding windows as CDDA already does today.) |
I did a quick and (very) dirty implementation of One issue that is immediately apparent is that the ID of the window isn't recorded in I quickly looked over other uses of |
I think there are multiple issues and some of them are going to requires rather deep work to untangle. What's a little bit arbitrary is how Test Engine favors using "paths" to both windows and items and I found it quite valuable when those paths are rather obvious to the users rather than requiring some guessing and convoluted function (and I think it could become valuable to main lib as well, e.g. #331). The names generated by There's just a lots of untangle together here so I don't have a clear answer. But as the problem AFAIK only apply to modals, and it would be easier and consistent that |
After submitting that wall of text I recalled there was also value that a modal state (e.g. position, size) would be reused regardless of the modal calling spot in the popup stack, making this even more tricky to deal with... (and consider that Considering the fact that it is currently possible to manually perform the equivalent of your |
Version/Branch of Dear ImGui:
1.90.3
Back-ends:
imgui_impl_dx11.cpp + imgui_impl_win32.cpp
Compiler, OS:
Windows 10 + MSVC 2022 (17.9.0p5)
Full config/build information:
No response
Details:
Popups effectively have two IDs:
ImGuiWindow
representing the popup, which does not participate in the ID stackBoth are derived from the ID passed to
BeginPopup
,OpenPopup
, etc.As a result, it's relatively easy to create two popups with different popup IDs but the same window ID.
If both of these popups are visible at the same time neither will render, and the case of modals UI will become unresponsive.
To reproduce:
DrawLists
andPopups
Show outer test modal
DrawLists
andPopups
in the metrics window.Show inner test modal
Popups
list but neither will be in theDrawLists
list.I suspect this might be the same as #6939 but the user couldn't figure out what was happening.
Screenshots/Video:
After opening outer modal:
After opening inner modal:
(Note that metrics window shows both popups as open but their draw lists are not being submitted.)
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: