From 65647e9c7d69bedfd0f9999e75e8b1ef9d9140fc Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Fri, 4 Nov 2022 22:24:00 +0100 Subject: 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. --- scene/main/viewport.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scene/main') 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 &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; -- cgit v1.2.3