Repository: godotengine/godot (language: cpp)

Issue:
Duplication menu behind embedded game
### Tested versions

v4.4.beta1.official [d33da79d3]

### System information

Windows 11

### Issue description

While the game is running and embedded in the editor, trying to duplicate a folder (and probably anything) opens the duplication menu but it appears behind the game, making it completely invisible and not accept any input (even escape or enter does nothing) so it appears like the application froze

https://github.com/user-attachments/assets/bc913bf7-f340-4f00-9d64-28f405dd2407

### Steps to reproduce

as told above

### Minimal reproduction project (MRP)

.


Discussion / hints:
It seemed to me that it could be related.

https://github.com/godotengine/godot/issues/101654
Are you in single window mode? It's a known issue for single window mode right now since the error popup is not a real window it's not possible to put it in front of the game window. Unfortunately, I don't have a nice solution for that right now.
see Known Issues in: https://github.com/godotengine/godot/pull/99010#issue-2646752561

And yes, it's basically the same issue as: https://github.com/godotengine/godot/issues/101654 #except that the confirmation popup is a modal window.

Yes single window mode. It's not directly related but it's made so much worse by that windows don't close on pressing escape if you click outside the window. if i run the game and open any of these popups (like about as well) and then press anywhere there is nothing you can do except awkwardly resize so its in view. F8 to stop running, escape, alt+F4, nothing works

Fix patch:
diff --git a/editor/plugins/game_view_plugin.cpp b/editor/plugins/game_view_plugin.cpp
index ad0f7e636ea6..9a55a2ece124 100644
--- a/editor/plugins/game_view_plugin.cpp
+++ b/editor/plugins/game_view_plugin.cpp
@@ -223,7 +223,7 @@ void GameView::_instance_starting(int p_idx, List<String> &r_arguments) {
 	if (!is_feature_enabled) {
 		return;
 	}
-	if (p_idx == 0 && embed_on_play && make_floating_on_play && !window_wrapper->get_window_enabled() && EditorNode::get_singleton()->is_multi_window_enabled() && _get_embed_available() == EMBED_AVAILABLE) {
+	if (p_idx == 0 && embed_on_play && make_floating_on_play && !window_wrapper->get_window_enabled() && _get_embed_available() == EMBED_AVAILABLE) {
 		// Set the Floating Window default title. Always considered in DEBUG mode, same as in Window::set_title.
 		String appname = GLOBAL_GET("application/config/name");
 		appname = vformat("%s (DEBUG)", TranslationServer::get_singleton()->translate(appname));
@@ -423,6 +423,9 @@ GameView::EmbedAvailability GameView::_get_embed_available() {
 	if (!DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_WINDOW_EMBEDDING)) {
 		return EMBED_NOT_AVAILABLE_FEATURE_NOT_SUPPORTED;
 	}
+	if (!EditorNode::get_singleton()->is_multi_window_enabled()) {
+		return EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE;
+	}
 
 	EditorRun::WindowPlacement placement = EditorRun::get_window_placement();
 	if (placement.force_fullscreen) {
@@ -477,6 +480,9 @@ void GameView::_update_ui() {
 		case EMBED_NOT_AVAILABLE_FULLSCREEN:
 			state_label->set_text(TTR("Game embedding not available when the game starts in fullscreen.\nConsider overriding the window mode project setting with the editor feature tag to Windowed to use game embedding while leaving the exported project intact."));
 			break;
+		case EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE:
+			state_label->set_text(TTR("Game embedding not available in single window mode."));
+			break;
 	}
 
 	if (available == EMBED_AVAILABLE) {
@@ -495,8 +501,7 @@ void GameView::_update_embed_menu_options() {
 	menu->set_item_checked(menu->get_item_index(EMBED_RUN_GAME_EMBEDDED), embed_on_play);
 	menu->set_item_checked(menu->get_item_index(EMBED_MAKE_FLOATING_ON_PLAY), make_floating_on_play);
 
-	// When embed is Off or in single window mode, Make floating is not available.
-	menu->set_item_disabled(menu->get_item_index(EMBED_MAKE_FLOATING_ON_PLAY), !embed_on_play || !EditorNode::get_singleton()->is_multi_window_enabled());
+	menu->set_item_disabled(menu->get_item_index(EMBED_MAKE_FLOATING_ON_PLAY), !embed_on_play);
 
 	fixed_size_button->set_pressed(embed_size_mode == SIZE_MODE_FIXED);
 	keep_aspect_button->set_pressed(embed_size_mode == SIZE_MODE_KEEP_ASPECT);
diff --git a/editor/plugins/game_view_plugin.h b/editor/plugins/game_view_plugin.h
index c4fb9d37f9ca..7402b270e3c0 100644
--- a/editor/plugins/game_view_plugin.h
+++ b/editor/plugins/game_view_plugin.h
@@ -106,6 +106,7 @@ class GameView : public VBoxContainer {
 		EMBED_NOT_AVAILABLE_MINIMIZED,
 		EMBED_NOT_AVAILABLE_MAXIMIZED,
 		EMBED_NOT_AVAILABLE_FULLSCREEN,
+		EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE,
 	};
 
 	inline static GameView *singleton = nullptr;


Test patch: