From 3766d40394a9f4b66a919085ae25db89cb16d7b1 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 3 Sep 2025 17:50:10 +0200 Subject: [PATCH] Nav: fixed Ctrl+Tab window appearing as empty when the sole active and focused window has the ImGuiWindowFlags_NoNavFocus flag. (#8914) --- docs/CHANGELOG.txt | 4 +++- imgui.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 9d1710a6d..4a28876bc 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -50,7 +50,9 @@ Other Changes: - Clipper, Tables: added ImGuiListClipperFlags_NoSetTableRowCounters as a way to disable the assumption that 1 clipper item == 1 table row, which breaks when e.g. using clipper with ItemsHeight=1 in order to clip in pixel units. (#8886) -- Fixed Bullet() fixed tesselation amount which looked out of place in very large sizes. +- Nav: fixed Ctrl+Tab window appearing as empty when the sole active and focused + window has the ImGuiWindowFlags_NoNavFocus flag. (#8914) +- Bullet: fixed tesselation amount which looked out of place in very large sizes. - InputText: allow passing an empty string with buf_size==0. (#8907) In theory the buffer size should always account for a zero-terminator, but idioms such as using InputTextMultiline() with ImGuiInputTextFlags_ReadOnly to display diff --git a/imgui.cpp b/imgui.cpp index 07537df87..a4128f2dc 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -14253,7 +14253,7 @@ static void ImGui::NavUpdateWindowing() g.NavWindowingInputSource = g.NavInputSource = ImGuiInputSource_Gamepad; } if (start_windowing_with_gamepad || start_windowing_with_keyboard) - if (ImGuiWindow* window = g.NavWindow ? g.NavWindow : FindWindowNavFocusable(g.WindowsFocusOrder.Size - 1, -INT_MAX, -1)) + if (ImGuiWindow* window = (g.NavWindow && IsWindowNavFocusable(g.NavWindow)) ? g.NavWindow : FindWindowNavFocusable(g.WindowsFocusOrder.Size - 1, -INT_MAX, -1)) { if (start_windowing_with_keyboard || g.ConfigNavWindowingWithGamepad) g.NavWindowingTarget = g.NavWindowingTargetAnim = window->RootWindow; // Current location