diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index ddf9cac7dde..d2be1ce6a71 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2663,6 +2663,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;