1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

Do not lose focus on the dock window when a PopUp opens

This commit is contained in:
Cayetano 2025-04-18 12:16:51 +02:00
parent 87f12e56fe
commit 2ff8366d40

View file

@ -18462,7 +18462,7 @@ static bool IsDockNodeTitleBarHighlighted(ImGuiDockNode* node, ImGuiDockNode* ro
{
// FIXME: This could all be backed in RootWindowForTitleBarHighlight? Probably need to reorganize for both dock nodes + other RootWindowForTitleBarHighlight users (not-node)
ImGuiWindow* parent_window = g.NavWindow->RootWindow;
while (parent_window->Flags & ImGuiWindowFlags_ChildMenu)
while (parent_window->Flags & (ImGuiWindowFlags_ChildMenu|ImGuiWindowFlags_Popup) && !(parent_window->Flags & ImGuiWindowFlags_Modal))
parent_window = parent_window->ParentWindow->RootWindow;
ImGuiDockNode* start_parent_node = parent_window->DockNodeAsHost ? parent_window->DockNodeAsHost : parent_window->DockNode;
for (ImGuiDockNode* parent_node = start_parent_node; parent_node != NULL; parent_node = parent_node->HostWindow ? parent_node->HostWindow->RootWindow->DockNode : NULL)