diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-07 17:53:46 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-07 17:53:46 +0200 |
commit | 81de16890e210103cecd4a3b866d172da6a1149e (patch) | |
tree | 1e62e21355250bec69f303385ee285b41365816b /scene/gui | |
parent | 22b599819a892a0685d4e41bab5bb6fca06aa7fd (diff) | |
parent | 2de52c74aea60f2115499a9bcd3698d5e96c4af4 (diff) |
Merge pull request #65375 from ItsNL/fix-accep-dialog-its_inside_tree-false
Condition "!is_inside_tree()" is true" when AcceptDialog was visible from the editor.
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/dialogs.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index deac7c96bb..f5edaf02d8 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -59,9 +59,16 @@ void AcceptDialog::_update_theme_item_cache() { void AcceptDialog::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_VISIBILITY_CHANGED: { + case NOTIFICATION_POST_ENTER_TREE: { if (is_visible()) { get_ok_button()->grab_focus(); + } + } break; + case NOTIFICATION_VISIBILITY_CHANGED: { + if (is_visible()) { + if (get_ok_button()->is_inside_tree()) { + get_ok_button()->grab_focus(); + } _update_child_rects(); parent_visible = get_parent_visible_window(); |