-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Confusing child window with ### in name with top level window #713
Comments
I am not sure what solution you would suggest here? Problem stem from the fact that Since your ### string is an explicit string because you could including your own ID within it? It would be a trivial workaround. |
There is no easy fix on imgui's side I can think of. I agree that this is probably not worth fixing. I am going to fix it on my side by using different string ids. It just cost me some time to find what's wrong and I wanted to save time for other people who encounter this bug. Maybe this problem can be mentioned in the documentation. Feel free to close this. |
Just an idea, maybe we can put assert in ImHash when there is |
Note that you can also use
We could add a strcmp() assert in the success path of |
That would be even better. |
Ah no, that's actually stupid :( it would defeat the whole purpose of
That's also incorrect unfortunately. Here the problem isn't that you have two `###' but merely that the ID after the final ### of both window names are matching. An unrelated assert that may have helped but completely by coincidence and not covering all cases, would be to check that e.g. the ImGuiWindowFlags_Child doesn't change. Note that you can also call Any other suggestion? |
I am simply generating different string for the child nem0/LumixEngine@3b9c08f Is it useful in any way to have ### in children? Maybe we can assert when there is ### in the child. |
Or |
Never required, since child name are never printed out to the user you can always get a unique id with the base name without ###, but I don't see why it should be disallowed. What sort of end-result did you get with the bug? Perhaps we could catch the error in a different spot. For example, for multiple begins in a same frame we could check that the parent is the same?
I don't understand, that would be no-op and equivalent to leaving things to way they are. |
This bug would be avoided, since something like
It triggers
Example: I have parent |
(I tagged this issue with commit only because the topics are similar but the issue discussed here is still valid.) |
I've been looking at this problem today as part of another set of of issues. Recap:
I'm tending toward this, aka more generally changing current law from:
Aka not including the ### in the hash.
Nothing new here, those ideas transpired in your post above, I'm mostly recapping for myself :) This seem decent but it also means we lose that "annotation" (the "Child1" part) from Debug Tools which may be undesirable, as I've seen people use "LocalizedName###SomeGUID". |
I have a top level window named
DockPanel###DockPanel
, its childShader Editor abc###Shader editor
and other top level windowShader Editor abc###Shader editor
. The wayImHash
works causes imgui to confuse the childShaderEditor
with the top levelShader Editor
The text was updated successfully, but these errors were encountered: