diff --git a/editor/plugins/game_view_plugin.cpp b/editor/plugins/game_view_plugin.cpp index 638262fb8be..efc5719d2de 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 6be2d961ba0..6e08c269b06 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;