mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Fix Tree and FileSystemList edit popup double events and ESC behavior.
This commit is contained in:
parent
f4b047a084
commit
7d4d63b807
5 changed files with 52 additions and 4 deletions
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
void Popup::_input_from_window(const Ref<InputEvent> &p_event) {
|
||||
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();
|
||||
}
|
||||
Window::_input_from_window(p_event);
|
||||
|
|
@ -104,13 +105,18 @@ void Popup::_notification(int p_what) {
|
|||
|
||||
case NOTIFICATION_WM_CLOSE_REQUEST: {
|
||||
if (!is_in_edited_scene_root()) {
|
||||
hide_reason = HIDE_REASON_UNFOCUSED;
|
||||
if (hide_reason == HIDE_REASON_NONE) {
|
||||
hide_reason = HIDE_REASON_UNFOCUSED;
|
||||
}
|
||||
_close_pressed();
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_APPLICATION_FOCUS_OUT: {
|
||||
if (!is_in_edited_scene_root() && get_flag(FLAG_POPUP)) {
|
||||
if (hide_reason == HIDE_REASON_NONE) {
|
||||
hide_reason = HIDE_REASON_UNFOCUSED;
|
||||
}
|
||||
_close_pressed();
|
||||
}
|
||||
} break;
|
||||
|
|
@ -119,7 +125,9 @@ void Popup::_notification(int p_what) {
|
|||
|
||||
void Popup::_parent_focused() {
|
||||
if (popped_up && get_flag(FLAG_POPUP)) {
|
||||
hide_reason = HIDE_REASON_UNFOCUSED;
|
||||
if (hide_reason == HIDE_REASON_NONE) {
|
||||
hide_reason = HIDE_REASON_UNFOCUSED;
|
||||
}
|
||||
_close_pressed();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue