From c689823c6009f8c0cc176f968a556e400e95c2da Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sun, 23 Jun 2024 00:01:39 +0300 Subject: [PATCH] Fix subwindow titlebar redraw on oversampling change. --- scene/main/viewport.cpp | 11 ++++++++++- scene/main/viewport.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 4d75e06ff9b..1302e3c53e6 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -309,7 +309,8 @@ void Viewport::_sub_window_update(Window *p_window) { int index = _sub_window_find(p_window); ERR_FAIL_COND(index == -1); - const SubWindow &sw = gui.sub_windows[index]; + SubWindow &sw = gui.sub_windows.write[index]; + sw.pending_window_update = false; Transform2D pos; pos.set_origin(p_window->get_position()); @@ -972,6 +973,14 @@ void Viewport::update_canvas_items() { return; } + if (is_embedding_subwindows()) { + for (Viewport::SubWindow w : gui.sub_windows) { + if (w.window && !w.pending_window_update) { + w.pending_window_update = true; + callable_mp(this, &Viewport::_sub_window_update).call_deferred(w.window); + } + } + } _update_canvas_items(this); } diff --git a/scene/main/viewport.h b/scene/main/viewport.h index df09755d4f6..0d31c07e57e 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -340,6 +340,7 @@ private: Window *window = nullptr; RID canvas_item; Rect2i parent_safe_rect; + bool pending_window_update = false; }; // VRS