-
-
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
Context menus don't work on ColorEdit4 #4167
Comments
Hello, That's quite interesting.
There is indeed an issue with the fact that the Combo popup will share the same ID as the Context Item Popups and they will keep overriding each others. The immediate/easy workaround is simply to use another ID when caling However from my POV we are trying to encourage people from not passing an ID override when calling |
… context menu with the default item id. (#4167)
Pushed a fix: 029c83c |
Thanks so much for the quick response. Combo boxes work well with the fix. I changed all my code to call ImGui::ColorEdit4(name, &color->x, ImGuiColorEditFlags_Float);
// if (ImGui::BeginPopupContextItem(name)) { <-- this works!
if (ImGui::BeginPopupContextItem()) {
if (ImGui::MenuItem("Reset")) (void*)0;
ImGui::EndPopup();
} And this is the assertion that is failing:
I will open a separate issue for this if you want. Thanks in advance. |
Thanks! I'll look at this from pov of view of ColorEdit later (it uses a group + popup so may be different) |
All widgets using groups such as What I would do right now is to use The fix is not presently trivial, relates to #840, #2840, #2550, #1875 I think we may have to investigate the idea presented in #840 (which would mean that last item id would change when activating a sub-component, may be fine). |
Version/Branch of Dear ImGui:
Version: dear imgui, v1.79 WIP
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_opengl3.cpp + imgui_impl_sdl2.cpp
Operating System: macOS
My Issue/Question:
Context menus don't work on combo boxes but they work on other widgets. In the following code, if I right-click on
Combo
, all of ImGui freezes (but not the program itself). If I right-click onSlider
, it works fine.Standalone, minimal, complete and verifiable example:
The text was updated successfully, but these errors were encountered: