Skip to content

Commit

Permalink
Fix Game Embedding Not Available message on Wayland
Browse files Browse the repository at this point in the history
  • Loading branch information
Hilderin committed Feb 14, 2025
1 parent 750640c commit fe49507
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion editor/plugins/game_view_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 > Driver Server)."), 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."));
Expand Down
1 change: 1 addition & 0 deletions editor/plugins/game_view_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fe49507

Please sign in to comment.