diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-02-14 09:23:40 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-02-14 09:23:40 +0200 |
commit | 39b69e6f7622d44064c525e95d48892fb2ff3f9a (patch) | |
tree | d152f6e71733ba9c325bd2e078895946b5ede570 | |
parent | 4848877b802b17f4ab1aecfde42c81a7cc9b6f08 (diff) |
[Editor] Fix editor progress dialog auto closing on ESC press, and on application focus loss.
-rw-r--r-- | scene/gui/popup.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 2ea1b93810..432004dedc 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -36,7 +36,7 @@ void Popup::_input_from_window(const Ref<InputEvent> &p_event) { Ref<InputEventKey> key = p_event; - if (key.is_valid() && key->is_pressed() && key->get_keycode() == Key::ESCAPE) { + if (get_flag(FLAG_POPUP) && key.is_valid() && key->is_pressed() && key->get_keycode() == Key::ESCAPE) { _close_pressed(); } } @@ -102,12 +102,17 @@ void Popup::_notification(int p_what) { } } break; - case NOTIFICATION_WM_CLOSE_REQUEST: - case NOTIFICATION_APPLICATION_FOCUS_OUT: { + case NOTIFICATION_WM_CLOSE_REQUEST: { if (!is_in_edited_scene_root()) { _close_pressed(); } } break; + + case NOTIFICATION_APPLICATION_FOCUS_OUT: { + if (!is_in_edited_scene_root() && get_flag(FLAG_POPUP)) { + _close_pressed(); + } + } break; } } |