Fix Tooltip getting removed instantly in embedded Window

Tooltips are unfocusable Windows. This case was not handled correctly in
`Viewport::_sub_window_register`.
This commit is contained in:
Markus Sauermann 2023-06-11 12:22:59 +02:00
parent 37d1dfef9d
commit 9d40f99290

View file

@ -287,7 +287,11 @@ void Viewport::_sub_window_register(Window *p_window) {
gui.sub_windows.push_back(sw); gui.sub_windows.push_back(sw);
if (gui.subwindow_drag == SUB_WINDOW_DRAG_DISABLED) { if (gui.subwindow_drag == SUB_WINDOW_DRAG_DISABLED) {
if (p_window->get_flag(Window::FLAG_NO_FOCUS)) {
_sub_window_update_order();
} else {
_sub_window_grab_focus(p_window); _sub_window_grab_focus(p_window);
}
} else { } else {
int index = _sub_window_find(gui.currently_dragged_subwindow); int index = _sub_window_find(gui.currently_dragged_subwindow);
sw = gui.sub_windows[index]; sw = gui.sub_windows[index];