Merge pull request #114722 from bruvzg/x_focus
[Accessibility] Force keyboard focus to the exclusive child.
This commit is contained in:
commit
64bc9a25a3
1 changed files with 11 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue