diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/main/window.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 43de4187d4..1ca4f0018b 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -281,6 +281,11 @@ void Window::_clear_window() { DisplayServer::get_singleton()->delete_sub_window(window_id); window_id = DisplayServer::INVALID_WINDOW_ID; + // If closing window was focused and has a parent, return focus. + if (focused && transient_parent) { + transient_parent->grab_focus(); + } + _update_viewport_size(); RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_DISABLED); } |