-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Wrong z-order with ImGuiViewportFlags_NoAutoMerge and owned windows #4665
Description
Version/Branch of Dear ImGui:
Version: 1.85
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: custom engine
Compiler: MSVC v14.29
Operating System: Windows 10
My Issue/Question:
I use a custom backend for my engine where child windows are owned by the main window, like in the win32 backend. It means that child windows are always displayed over the main window, independently of the current focused window. I don't specify the ImGuiBackendFlags_HasMouseHoveredViewport flag and let ImGUI compute the current hovered viewport.
It works fine until I create a child window with the ImGuiViewportFlags_NoAutoMerge flag. If this window is placed over the main viewport, and we gives focus to the latter, ImGUI will suppose that it is now under the main viewport, which is wrong because it's an owned window and it's still drawn at the top, and mouse hovering won't work for it.
I think we need a way to tell ImGUI that child windows are owned to allow it to compute the z-order accordingly.
Screenshots/Video
