From 9d40f99290bc648f5c09625efc38264f03fd859e Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Sun, 11 Jun 2023 12:22:59 +0200 Subject: [PATCH] Fix Tooltip getting removed instantly in embedded Window Tooltips are unfocusable Windows. This case was not handled correctly in `Viewport::_sub_window_register`. --- scene/main/viewport.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 66bd60cc67f..d892baef2e6 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -287,7 +287,11 @@ void Viewport::_sub_window_register(Window *p_window) { gui.sub_windows.push_back(sw); if (gui.subwindow_drag == SUB_WINDOW_DRAG_DISABLED) { - _sub_window_grab_focus(p_window); + if (p_window->get_flag(Window::FLAG_NO_FOCUS)) { + _sub_window_update_order(); + } else { + _sub_window_grab_focus(p_window); + } } else { int index = _sub_window_find(gui.currently_dragged_subwindow); sw = gui.sub_windows[index];