summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2022-11-04 22:24:00 +0100
committerMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2022-11-04 22:24:00 +0100
commit65647e9c7d69bedfd0f9999e75e8b1ef9d9140fc (patch)
tree801be8cc86cd3229a75f2c6ff2e7d51559a7e942 /scene
parent191c8ed12f624ec97b650b2726fed4e8c4bcf04c (diff)
Fix Windowfocus on resizing
When resizing a non-focused window, the previously focused Window got resized. This patch grabs focus for the actually resized window, before starting with the resizing.
Diffstat (limited to 'scene')
-rw-r--r--scene/main/viewport.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index f8b0a66a71..6cc9c83aed 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -2662,6 +2662,11 @@ bool Viewport::_sub_windows_forward_input(const Ref<InputEvent> &p_event) {
} else {
gui.subwindow_resize_mode = _sub_window_get_resize_margin(sw.window, mb->get_position());
if (gui.subwindow_resize_mode != SUB_WINDOW_RESIZE_DISABLED) {
+ if (gui.subwindow_focused != sw.window) {
+ // Refocus.
+ _sub_window_grab_focus(sw.window);
+ }
+
gui.subwindow_resize_from_rect = r;
gui.subwindow_drag_from = mb->get_position();
gui.subwindow_drag = SUB_WINDOW_DRAG_RESIZE;