-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
NoFocusOnAppearing on a popup makes it appear behind the parent window after clicking on a Selectable. #4461
Comments
I fixed my issue by calling Though I still think this is a bug. |
Hello and sorry for my later answer.
Using the workaround is reasonable until we decide if we change that definition, but it is best to use with a if (ImGui::IsWindowAppearing())
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow()); I am currently investigating another related issue and it might contribute to evolving the design of the |
Linking to #718 which aims for the same end result and has lots of ideas. |
Information:
Version: 1.84.1 (master) with 1 modification (see below)
Backend: SDL + OpenGL 3
Compiler: clang on Linux
My Issue/Question:
Using the
ImGuiWindowFlags_NoFocusOnAppearing
flag on a (popup) window makes it appear behind the parent window after clicking aSelectable
inside that popup. I don't know whether this is a bug, or if I am missing something and I don't know enough about ImGui to tell. But since it works correctly until I click aSelectable
, I believe this is a bug.Background: Like many others, I'm trying to create a combo box under an
InputText
. To do that, I took some parts ofBeginCombo
and then usedBeginComboPopup
to create the actual popup. It works great!Since popups take focus by default, I had to add a parameter to
BeginComboPopup
so that I can passImGuiWindowFlags_NoFocusOnAppearing
to theBegin
call inBeginComboPopup
. And this works, until I click on aSelectable
. After that, the popup renders behind the main window.I tried to look at the code about what happens differently when passing
NoFocusOnAppearing
and I looked atSelectable
, but I didn't see anything stand out (but I'm also a complete newcomer to ImGui so that doesn't mean anything).Screenshot
Standalone, minimal, complete and verifiable example:
The text was updated successfully, but these errors were encountered: