[Accessibility] Process non-focusable windows (popups, menus) as part of the parent window tree.

This commit is contained in:
Pāvels Nadtočajevs 2025-07-28 11:27:43 +03:00
parent 0c51ede243
commit 7b47f5e8db
No known key found for this signature in database
GPG key ID: 8413210218EF35D2
8 changed files with 96 additions and 42 deletions

View file

@ -38,7 +38,7 @@
#include "scene/theme/theme_db.h"
void Popup::_input_from_window(const Ref<InputEvent> &p_event) {
if ((ac_popup || get_flag(FLAG_POPUP)) && p_event->is_action_pressed(SNAME("ui_cancel"), false, true)) {
if (get_flag(FLAG_POPUP) && p_event->is_action_pressed(SNAME("ui_cancel"), false, true)) {
hide_reason = HIDE_REASON_CANCELED; // ESC pressed, mark as canceled unconditionally.
_close_pressed();
}
@ -115,7 +115,7 @@ void Popup::_notification(int p_what) {
} break;
case NOTIFICATION_APPLICATION_FOCUS_OUT: {
if (!is_in_edited_scene_root() && (get_flag(FLAG_POPUP) || ac_popup)) {
if (!is_in_edited_scene_root() && get_flag(FLAG_POPUP)) {
if (hide_reason == HIDE_REASON_NONE) {
hide_reason = HIDE_REASON_UNFOCUSED;
}
@ -126,7 +126,7 @@ void Popup::_notification(int p_what) {
}
void Popup::_parent_focused() {
if (popped_up && (get_flag(FLAG_POPUP) || ac_popup)) {
if (popped_up && get_flag(FLAG_POPUP)) {
if (hide_reason == HIDE_REASON_NONE) {
hide_reason = HIDE_REASON_UNFOCUSED;
}