Repository: godotengine/godot (language: cpp)

Issue:
Invalid startup embedded game location and size after resizing editor main area
### Tested versions

- Reproductive in Godot 4.4 RC3, RC2

### System information

Godot v4.4.rc3 - Windows 11 (build 26100) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 Laptop GPU (NVIDIA; 32.0.15.7260) - AMD Ryzen 7 5800H with Radeon Graphics (16 threads)

### Issue description

When the game is embedded in the editor, if when editor main area is resized, the next time the embedded game is started it will startup with the previous location and sizse.

### Steps to reproduce

- Activate embedded without floating window
- Start the game the first time, location and size will be OK
- Stop the game
- Resize a floating dock or the bottom panel when your are not in the Game tab
- Start the game again
- For a split second, the game will be displayed at the previous location and size before the resizing in the editor (the location and size of the previous startup)

https://github.com/user-attachments/assets/94d29bef-e8b1-4b56-b1f6-6cef7560c6d9

### Minimal reproduction project (MRP)

Any project


Discussion / hints:

Fix patch:
diff --git a/editor/plugins/game_view_plugin.cpp b/editor/plugins/game_view_plugin.cpp
index 30c558e0bd5d..bc3b4ceeb2b7 100644
--- a/editor/plugins/game_view_plugin.cpp
+++ b/editor/plugins/game_view_plugin.cpp
@@ -257,7 +257,7 @@ void GameView::_show_update_window_wrapper() {
 	Point2 offset_embedded_process = embedded_process->get_global_position() - get_global_position();
 
 	// On the first startup, the global position of the embedded process control is invalid because it was
-	// never displayed. We will calculated it manually using the minimum size of the window.
+	// never displayed. We will calculate it manually using the minimum size of the window.
 	if (offset_embedded_process == Point2()) {
 		offset_embedded_process.y = wrapped_min_size.y;
 	}
@@ -812,9 +812,8 @@ void GameView::_update_arguments_for_instance(int p_idx, List<String> &r_argumen
 	_update_embed_window_size();
 	Rect2i rect = embedded_process->get_screen_embedded_window_rect();
 
-	// On the first startup, the global rect of the embedded process control is invalid because it was
-	// never displayed. We will calculated it manually.
-	if (!window_wrapper->get_window_enabled() && rect.size.y < embedded_process->get_custom_minimum_size().y) {
+	// Usually, the global rect of the embedded process control is invalid because it was hidden. We will calculate it manually.
+	if (!window_wrapper->get_window_enabled()) {
 		Size2 old_min_size = embedded_process->get_custom_minimum_size();
 		embedded_process->set_custom_minimum_size(Size2i());
 


Test patch: