From 32a3c61d0001d75cdcf033015a1e27f1ea12c848 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 11 Jan 2024 19:48:31 +0100 Subject: [PATCH] Internals: Shortcut() follow docking chain (until we formalize a more general focus scope stack). (#456) --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index f4a1d852..49edd5b0 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -8931,7 +8931,7 @@ static int CalcRoutingScore(ImGuiWindow* location, ImGuiID owner_id, ImGuiInputF return 1; // Early out when not in focus stack - if (focused == NULL || focused->RootWindow != location->RootWindow) + if (focused == NULL || focused->RootWindowDockTree != location->RootWindowDockTree) return 255; // Score based on distance to focused window (lower is better) @@ -8947,7 +8947,7 @@ static int CalcRoutingScore(ImGuiWindow* location, ImGuiID owner_id, ImGuiInputF IM_ASSERT(next_score < 255); return next_score; } - focused = (focused->RootWindow != focused) ? focused->ParentWindow : NULL; // FIXME: This could be later abstracted as a focus path + focused = (focused->RootWindowDockTree != focused) ? focused->ParentWindow : NULL; // FIXME: This could be later abstracted as a focus path } return 255; }