- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 11.3k
 
Description
Version/Branch of Dear ImGui:
Version 1.92.4, Branch: docking
Back-ends:
imgui_impl_glfw.cpp + imgui_impl_vulkan.cpp
Compiler, OS:
Win 11 + MSVC
Full config/build information:
No response
Details:
I still have some issues with windows in secondary viewport which sometimes remain above the main window.
Looking at the debug on viewports I noted that when a window is moved out of the main viewport (viewport creation) the Platform focus remains on the main viewport and it not transferred to the new one.
Then the bug arise when I select a window of the main viewport : it remains behind the secondary viewport (cf images below). In the Z order debug the Hello World is still on top.
This because we did not have the log "[viewport] Focused viewport changed" because the platform focus remained on the main viewport. This is only the case when the viewport is just created (If I select again Hello World it gets plateform focus and everything is fine).
Then in glfw I see we intentionally do not set focus on the window when creating it (glfwWindowHint(GLFW_FOCUSED, false);), maybe it was leading to other issues ?
I reproduced this with the standard example, just update GLFW to 3.4.
Screenshots/Video:
Viewport creation, but does not get platform focus:

Leads to focus not assigned to main viewport when selecting it: (Hello World shall not hide focused window)
