From 89372664a20a8bd3014a66090b7f39e2e899fdf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Thu, 8 Jan 2026 08:13:22 +0200 Subject: [PATCH] [Accessibility] Force keyboard focus to the exclusive child. --- scene/main/window.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 81de401f00..fb35ac5078 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -823,6 +823,17 @@ void Window::_event_callback(DisplayServer::WindowEvent p_event) { focused_window = this; _propagate_window_notification(this, NOTIFICATION_WM_WINDOW_FOCUS_IN); emit_signal(SceneStringName(focus_entered)); + if (get_tree() && get_tree()->is_accessibility_enabled()) { + Window *w = exclusive_child; + while (w) { + if (w->exclusive_child) { + w = w->exclusive_child; + } else { + w->grab_focus(); + break; + } + } + } } break; case DisplayServer::WINDOW_EVENT_FOCUS_OUT: { focused = false;