Unfocused floating viewports obscure docking node drop targets
Version/Branch of Dear ImGui:
docking
Back-ends:
Win32 + Vulkan
Compiler, OS:
Windows 10 + MSVC
Full config/build information:
No response
Details:
Docking icons render correctly when floating viewports are merged into the main viewport.
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
.\examples\example_win32_vulkan\main.cpp
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows
... ImGui::NewFrame(); ImGui::DockSpaceOverViewport(); ...
I'm not sure how to fix that, other than perhaps claiming focus on a viewport while holding on it (the same way you can open tree node or tabs by holding a drag and drop payload).
Note that by default the win32 backends creates a parent<>child relationship between main and secondary viewports, which effectively makes it impossible for that main viewport to appears in front of the others, but you can set io.ConfigViewportsNoDefaultParent = true to disable that behavior and then you can more easily reorder viewports.
Is it technically feasible to implement docking node drop targets in a dedicated overlay window utilizing both Win32's WS_EX_LAYERED (for transparency effects) and WS_EX_TOPMOST extended styles?
It would be a good solution to solve this and #2361.
However for this particular issue at hand, it would be ambiguous to show the overlay over the "Dear ImGui Demo" window because hovering in those locations wouldn't technically be hovering the target dockspace. It would be more correct to trigger focus on drag-hold but that requires backend to support unparenting (win32 backend does) + set io.ConfigViewportsNoDefaultParent (which we might decide to make the default).