Backends: GLFW: Support for viewport parenting (Windows only)
Version/Branch of Dear ImGui:
Version: 1.89.6 WIP Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_glfw.cpp Compiler: visual studio Operating System: windows
My Issue/Question:
There is a limitation with glfw that creates some issues when using imgui with that backend on windows. If the user has ConfigViewportsNoTaskBarIcon enabled then detached imgui windows can get hidden behind other application windows, with no easy way to bring them back to the foreground. To see the issue just compile the glfw example on windows with ConfigViewportsNoTaskBarIcon=true.
My Solution:
You can set the GWLP_HWNDPARENT after the window has been created to get the same behavior that is offered in the windows imgui backend. Right now I've set it to only do this when NoTaskBarIcon is enabled, however the windows example backend always sets the parent.
A few things:
- Instead of always setting the main viewport as the parent, this should honor
ParentViewportID(seeimgui_impl_win32as an example.) - The disclaimer about
ParentViewportIDat the top of the file should be reworded something along the lines of "has no effect on platforms other than Win32" - Your PR should target the
dockingbranch instead ofmaster. (Click theEditbutton towards the top of the page and change the base branch using the dropdown.)
Thanks for the feedback, I've changed the code to use ParentViewportID.
Is the auto keyword allowed in the code base?