From 408de3c9705a90c05ac742beebe2817c4205ae7d Mon Sep 17 00:00:00 2001 From: Riteo Date: Tue, 20 May 2025 23:54:56 +0200 Subject: [PATCH] Wayland: Fix window fitting in single-window mode We disabled window fitting in multi-window mode as it was broken due to the limited data but it should still be enabled for embedded windows. --- scene/gui/popup.cpp | 2 +- scene/main/window.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index a2e73e41649..adfbd7f112a 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -167,7 +167,7 @@ Rect2i Popup::_popup_adjust_rect() const { Rect2i current(get_position(), get_size()); - if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SELF_FITTING_WINDOWS)) { + if (!is_embedded() && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SELF_FITTING_WINDOWS)) { // We're fine as is, the Display Server will take care of that for us. return current; } diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 0905bc8c42f..696e09eb1f6 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -1994,7 +1994,7 @@ void Window::popup(const Rect2i &p_screen_rect) { // Update window size to calculate the actual window size based on contents minimum size and minimum size. _update_window_size(); - bool should_fit = !DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SELF_FITTING_WINDOWS); + bool should_fit = is_embedded() || !DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SELF_FITTING_WINDOWS); if (p_screen_rect != Rect2i()) { set_position(p_screen_rect.position);