Repository: godotengine/godot (language: cpp)

Issue:
"Game Embedding not available on your OS" EndeavorOS Hyprland
### Tested versions

Reproducible in: 4.4.beta3

### System information

Godot v4.4.beta3 - EndeavourOS #1 SMP PREEMPT_DYNAMIC Sun, 02 Feb 2025 01:02:29 +0000 on Wayland - Wayland display driver, Single-window, 1 monitor - Vulkan (Forward+) - integrated Intel(R) HD Graphics 500 (APL 2) - Intel(R) Celeron(R) CPU N3350 @ 1.10GHz (2 threads)

### Issue description

Was going to test for the first time the game embedding from 4.4 and was surprised to seed it did not work, the devlogs said it was available for linux so that got me wondering if it was a Hyprland issue, but I could not find anything online, or on the issues, easily available.

### Steps to reproduce

- Create any new project
- Run any scene
- Open game tab

### Minimal reproduction project (MRP)

Any godot project


Discussion / hints:
The message is effectively not very clear in your situation. Right now, the Game Embedding is not available when Godot Editor is using the Wayland display driver. It only support x11. It works on Linux Wayland if using X11 display driver.

It's documented in the original PR: https://github.com/godotengine/godot/pull/99010

I'll check if the message could be adjusted for Linux.

Fix patch:
diff --git a/editor/plugins/game_view_plugin.cpp b/editor/plugins/game_view_plugin.cpp
index 638262fb8bec..efc5719d2def 100644
--- a/editor/plugins/game_view_plugin.cpp
+++ b/editor/plugins/game_view_plugin.cpp
@@ -446,6 +446,10 @@ GameView::EmbedAvailability GameView::_get_embed_available() {
 	if (get_tree()->get_root()->is_embedding_subwindows()) {
 		return EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE;
 	}
+	String display_driver = GLOBAL_GET("display/display_server/driver");
+	if (display_driver == "headless" || display_driver == "wayland") {
+		return EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER;
+	}
 
 	EditorRun::WindowPlacement placement = EditorRun::get_window_placement();
 	if (placement.force_fullscreen) {
@@ -489,7 +493,14 @@ void GameView::_update_ui() {
 			}
 			break;
 		case EMBED_NOT_AVAILABLE_FEATURE_NOT_SUPPORTED:
-			state_label->set_text(TTR("Game embedding not available on your OS."));
+			if (DisplayServer::get_singleton()->get_name() == "Wayland") {
+				state_label->set_text(TTR("Game embedding not available on Wayland.\nWayland can be disabled in the Editor Settings (Run > Platforms > Linux/*BSD > Prefer Wayland)."));
+			} else {
+				state_label->set_text(TTR("Game embedding not available on your OS."));
+			}
+			break;
+		case EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER:
+			state_label->set_text(vformat(TTR("Game embedding not available for the Display Server: '%s'.\nDisplay Server can be modified in the Project Settings (Display > Display Server > Driver)."), GLOBAL_GET("display/display_server/driver")));
 			break;
 		case EMBED_NOT_AVAILABLE_MINIMIZED:
 			state_label->set_text(TTR("Game embedding not available when the game starts minimized.\nConsider overriding the window mode project setting with the editor feature tag to Windowed to use game embedding while leaving the exported project intact."));
diff --git a/editor/plugins/game_view_plugin.h b/editor/plugins/game_view_plugin.h
index 6be2d961ba08..6e08c269b063 100644
--- a/editor/plugins/game_view_plugin.h
+++ b/editor/plugins/game_view_plugin.h
@@ -108,6 +108,7 @@ class GameView : public VBoxContainer {
 		EMBED_NOT_AVAILABLE_MAXIMIZED,
 		EMBED_NOT_AVAILABLE_FULLSCREEN,
 		EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE,
+		EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER,
 	};
 
 	inline static GameView *singleton = nullptr;


Test patch: