浏览代码

Merge pull request #106657 from Riteo/mfw-single-window-mode-broke

Wayland: Fix window fitting in single-window mode
Thaddeus Crews 3 月之前
父节点
当前提交
f1e18433d1
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      scene/gui/popup.cpp
  2. 1 1
      scene/main/window.cpp

+ 1 - 1
scene/gui/popup.cpp

@@ -167,7 +167,7 @@ Rect2i Popup::_popup_adjust_rect() const {
 
 
 	Rect2i current(get_position(), get_size());
 	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.
 		// We're fine as is, the Display Server will take care of that for us.
 		return current;
 		return current;
 	}
 	}

+ 1 - 1
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 to calculate the actual window size based on contents minimum size and minimum size.
 	_update_window_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()) {
 	if (p_screen_rect != Rect2i()) {
 		set_position(p_screen_rect.position);
 		set_position(p_screen_rect.position);