ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
60.8k stars 10.27k forks source link

Using BeginMenu without a menu bar: menu popups stays open #1633

Closed elliotjb closed 2 years ago

elliotjb commented 6 years ago

Hi, i create a Engine3D with ImGui and i have a problem with ImGui::MenuItem and ImGui::BeginMenu. (imgui, v1.53) Look gif:

https://gyazo.com/4b2734e99c690211590ac1396655bea4

This is in code: https://github.com/Project3CITM/CulverinEngine-Project3/blob/master/Engine/GameObject.cpp#L1008

https://gyazo.com/071c8e3aac09833d8261d601c4d0193d

I use these functions in other parts of engine and I haven't any problems. I dont know what to do. I suppose that i used incorrectly form ImGui::MenuItem.

From Imgui.cpp I have only created some functions to create buttons with text below.

Thanks,

Elliot JB

ocornut commented 6 years ago

FYI, this is currently happening when you create menus from outside of a menu bar.

It's not a 10 minutes fix unfortunately, because BeginMenu() is really tricky and this improve bypassing the mechanism that inhibit hovering on the parent of a popup. I know of various "fixes" that would break something else, and the right fix will take a bit of research to find.

I'll look into it at some point.

elliotjb commented 6 years ago

Thank you very much for the speed, for now I will remove the BeginMenu() and put them with MenuItem().

I'll be attentive to what you find, thanks.

ocornut commented 2 years ago

Forgot to mention but AFAIK this was fixed in 1.86 by the series of change done for #3496 and #4797.