Skip to content

GH-1226 Have Wayland chosen as default if user is using it#1227

Draft
JoltedJon wants to merge 1 commit intoRedot-Engine:masterfrom
JoltedJon:GH-1226
Draft

GH-1226 Have Wayland chosen as default if user is using it#1227
JoltedJon wants to merge 1 commit intoRedot-Engine:masterfrom
JoltedJon:GH-1226

Conversation

@JoltedJon
Copy link
Contributor

@JoltedJon JoltedJon commented Mar 15, 2026

Fixes #1226 Current Design of Godot has it so that you have to explicitly set Wayland as the chosen display driver in project settings or via the command line. This change will automatically have Wayland chosen if detected and the display driver is set to the default driver. Essentially making the default chosen option the display server that the user is using instead of X11.

This may have some consequences since there are mentions of wayland features not being entirely complete, but that is something we can work towards. godotengine/godot#88346

Summary by CodeRabbit

  • New Features
    • Display driver configuration now automatically selects Wayland when set to default and Wayland is available on the system.

@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3510a376-5b4d-4c65-a782-313edc2510a9

📥 Commits

Reviewing files that changed from the base of the PR and between 69866b2 and e26a4a6.

📒 Files selected for processing (1)
  • main/main.cpp

Walkthrough

Adds logic to auto-select Wayland as the display driver when "default" is specified and the WAYLAND_DISPLAY environment variable is set, preventing fallback to X11 on Wayland systems.

Changes

Cohort / File(s) Summary
Wayland auto-selection
main/main.cpp
Adds conditional check in Main::setup2 to detect WAYLAND_DISPLAY environment variable and auto-select Wayland driver before standard driver selection logic when "default" driver is specified.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: implementing automatic Wayland selection when it is the user's default display server.
Linked Issues check ✅ Passed The code change implements the requirement from issue #1226 by detecting Wayland via WAYLAND_DISPLAY environment variable and auto-selecting it as the display driver when set to default.
Out of Scope Changes check ✅ Passed The changes are limited to the display driver selection logic in main.cpp and are directly related to the Wayland detection objective outlined in issue #1226.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@AR-DEV-1 AR-DEV-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small fix, LGTM. Better to use Wayland where X11 doesn't have good support or Wayland is being used by default.

@Arctis-Fireblight
Copy link
Contributor

I am going to go ahead and mark this as a draft. We touched on these subjects on Discord, but I wanted to kinda recap my concerns for public record.

Wayland support is still marked as experimental in Godot. It seems there has been good progress on fixing issues, support for some Desktop Environments lag behind others, most notably GNOME.
We'll need to address some more of the known issues, and then likely do some extensive testing across various DEs before we can change the default behavior.

We may want to consider adding additional logic to detect the user's DE and default to XWayland in cases where the we know the Wayland implementation doesnt play nice with their DE or Distro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

X11 display server is getting chosen on machines running Wayland

3 participants