Skip to content

Commit b2aae7b

Browse files
committed
Merge pull request #102833 from Hilderin/fix-game-embeddeing-not-available-wayland
Fix "Game embedding not available" message on Wayland
2 parents 16285a6 + d9f6539 commit b2aae7b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

editor/plugins/game_view_plugin.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,10 @@ GameView::EmbedAvailability GameView::_get_embed_available() {
446446
if (get_tree()->get_root()->is_embedding_subwindows()) {
447447
return EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE;
448448
}
449+
String display_driver = GLOBAL_GET("display/display_server/driver");
450+
if (display_driver == "headless" || display_driver == "wayland") {
451+
return EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER;
452+
}
449453

450454
EditorRun::WindowPlacement placement = EditorRun::get_window_placement();
451455
if (placement.force_fullscreen) {
@@ -489,7 +493,14 @@ void GameView::_update_ui() {
489493
}
490494
break;
491495
case EMBED_NOT_AVAILABLE_FEATURE_NOT_SUPPORTED:
492-
state_label->set_text(TTR("Game embedding not available on your OS."));
496+
if (DisplayServer::get_singleton()->get_name() == "Wayland") {
497+
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)."));
498+
} else {
499+
state_label->set_text(TTR("Game embedding not available on your OS."));
500+
}
501+
break;
502+
case EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER:
503+
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")));
493504
break;
494505
case EMBED_NOT_AVAILABLE_MINIMIZED:
495506
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."));

editor/plugins/game_view_plugin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ class GameView : public VBoxContainer {
108108
EMBED_NOT_AVAILABLE_MAXIMIZED,
109109
EMBED_NOT_AVAILABLE_FULLSCREEN,
110110
EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE,
111+
EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER,
111112
};
112113

113114
inline static GameView *singleton = nullptr;

0 commit comments

Comments
 (0)