mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
[Accessibility] Process non-focusable windows (popups, menus) as part of the parent window tree.
This commit is contained in:
parent
0c51ede243
commit
7b47f5e8db
8 changed files with 96 additions and 42 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue