diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-01-15 20:47:34 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-01-18 11:47:03 +0200 |
commit | d62ca0c9c02fa202ca294e75c2bb12dfe774cc75 (patch) | |
tree | 25f96c4065b9df8ae6754e38d99a88b8a2a4037f /scene | |
parent | 8ae86f608a797d82a3546939181c830fa140e52b (diff) |
Window management improvements.
[macOS] Fix transient windows not working in the full-screen mode.
[macOS] Fix moving transient windows to the other screen than parent window.
[macOS] Fix popup menu switch on hover.
[macOS] Use content origin rect for windows position (to ensure `DS.mouse_get_position` is equal to `DS.window_get_position` + mouse position from the input events).
[macOS] Fix incorrect input coordinates, when external display with different scaling in connected/disconnected.
[macOS/Windows] Fix moving fullscreen windows between the screens.
Add auto refocusing of the parent window, when the focused transient window is closed.
Remove redundant `DS.mouse_get_absolute_position` function (returns mouse position in the screen coordinates, same as `DS.mouse_get_position`).
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); } |