Skip to content
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

Issue using IDs to prevent conflicts in popup windows #6939

Closed
mistahmikey opened this issue Oct 18, 2023 · 9 comments
Closed

Issue using IDs to prevent conflicts in popup windows #6939

mistahmikey opened this issue Oct 18, 2023 · 9 comments
Labels
label/id and id stack implicit identifiers, pushid(), id stack popups

Comments

@mistahmikey
Copy link

mistahmikey commented Oct 18, 2023

Version/Branch of Dear ImGui:

Version: 1.63

Back-end/Renderer/Compiler/OS

Back-ends: unknown
Operating System: Windows 11

My Issue/Question:

I have a use case where I want to pop up a persistent window with additional information by clicking on a table entry that is represented by a Selectable widget. So, if the user clicks on several different table entries, the popups remain displayed until explicitly closed. I create the popup roughly like so (my IMGui Api is a LUA binding, so I am showing a psuedocodeish version of what I am doing):

Begin("Additional Information##",true,WindowFlags_AlwaysAutoResize)

End()

What I am experiencing is that when I render subsequent popups, the existing popup presentations are impacted, i.e., it appears the popups are somehow using a shared rendering context. I read everything I could find about the ID system, and based on that, I don't understand why the unique id (across all the popup windows) that I use in the Begin does not appear to be preventing conflicts between the popups - I would expect each window to be rooted with a unique ID so that all subsequent widget ID paths are also unique.

Also, by using the Show Metrics Window, I noticed that the popup window IDs do in fact appear to be unique. But when I render new widgets, they appear to also be impacted by these defunct windows, as they briefly show other information but then quickly snap back to what was just rendered. A side question is - how do you tell IMGUI to "forget" a window, so all those windows that will never be rendered again don't clutter up the id/Window space.

Thanks!

@ocornut
Copy link
Owner

ocornut commented Oct 18, 2023

What I am experiencing is that when I render subsequent popups, the existing popup presentations are impacted, i.e., it appears the popups are somehow using a shared rendering context.

Please clarify what "somehow impacted" means, please provide videos/code and more details.

@ocornut
Copy link
Owner

ocornut commented Oct 18, 2023

Please also amend your issue with a copy of the template appearing when you attempt to a create a new issue.

@mistahmikey
Copy link
Author

Is there a way I can send you a private video of the issue?

@GamingMinds-DanielC
Copy link
Contributor

Version 1.63 is rather old, lots of cumulative interface changes will make that hard to support. You should consider upgrading if possible. Besides that, actual code might still help to pinpoint the issue, even in Lua form (provided that the binding itself doesn't have bugs).

As for "forgetting" windows: you can keep them out of your saved settings if you specify ImGuiWindowFlags_NoSavedSettings.

@mistahmikey
Copy link
Author

mistahmikey commented Oct 18, 2023 via email

@ocornut
Copy link
Owner

ocornut commented Oct 18, 2023

I am sorry I cannot be providing technical support for 1.63, it's a 5+ years old version.

If you provide media we might be able to help you pinpoint the issue, but I cannot accept private video for unpaying users.
Please find a way to publish something.

@ocornut ocornut closed this as completed Oct 18, 2023
@ocornut ocornut added popups label/id and id stack implicit identifiers, pushid(), id stack labels Oct 18, 2023
@ocornut
Copy link
Owner

ocornut commented Oct 19, 2023

To clarify:

  • you could perfectly build a minimum repro. that alone often helps you solve your issue.
  • then you test the repro on both 1.63 and on latest.
  • if the issue still happens on latest, we can have a discussion.
  • if the issue happens in 1.63 but not on latest, it's a behavior we improved/fixed.

@mistahmikey
Copy link
Author

mistahmikey commented Oct 19, 2023 via email

@ocornut
Copy link
Owner

ocornut commented Oct 19, 2023

Thanks for the clarification. Unfortunately, I don't control that situation, so I'll just have to figure this out myself.

I don't understand how my suggestion wouldn't apply to you or anyone.
If you want to report a bug accurately you have to make a minimum repro. If you can make one you can easily test it in your current version and in latest version using an example app.

Is this something I need to be concerned about?

No you shouldn't be concerned about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
label/id and id stack implicit identifiers, pushid(), id stack popups
Projects
None yet
Development

No branches or pull requests

3 participants