From 4877a964e4c9c9e5dcb8f216f8b1c9f560f0f321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Fri, 30 May 2025 08:27:00 +0300 Subject: [PATCH] Fix window embedding for windows with `force_native` enabled. --- scene/main/window.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 696e09eb1f..82da1233d4 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -1366,7 +1366,13 @@ void Window::set_force_native(bool p_force_native) { if (is_visible() && !is_in_edited_scene_root()) { ERR_FAIL_MSG("Can't change \"force_native\" while a window is displayed. Consider hiding window before changing this value."); } + if (window_id == DisplayServer::MAIN_WINDOW_ID) { + return; + } force_native = p_force_native; + if (!is_in_edited_scene_root() && get_tree()->get_root()->is_embedding_subwindows()) { + set_embedding_subwindows(force_native); + } } bool Window::get_force_native() const {