#22860: fix(browser): add --ozone-platform=wayland for Wayland-only Linux desktops
size: XS
Cluster:
Browser Enhancements and Fixes
## Summary
- Adds `--ozone-platform=wayland` to Chrome launch args when `WAYLAND_DISPLAY` is set but `DISPLAY` is not (pure Wayland desktop)
- Prevents Chrome from falling back to XWayland, which causes rendering issues or fails if XWayland is not installed
The flag is only added when `DISPLAY` is absent, so setups with both X11 and Wayland available are unaffected.
Fixes #14080
## Local Validation
- [x] Verified the condition correctly targets Wayland-only setups
- [x] Flag is placed in the existing Linux-specific block alongside `--disable-dev-shm-usage`
## Scope
XS — 3-line addition in one file
## AI Assistance
Used Claude Code for issue investigation and fix implementation.
## Author
@miloudbelarebia
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Added `--ozone-platform=wayland` flag to Chrome launch args when `WAYLAND_DISPLAY` is set but `DISPLAY` is not, which correctly targets pure Wayland environments. This prevents Chrome from attempting to use XWayland (which causes rendering failures on systems without XWayland installed). The logic matches the existing pattern in `src/commands/oauth-env.ts` where both environment variables are already used for environment detection.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The change is a targeted 3-line fix with clear conditional logic that only affects Linux systems in pure Wayland environments. The environment variable check pattern is already established in the codebase, and the flag is placed appropriately within the existing Linux-specific configuration block. No behavioral changes occur for systems with X11 or hybrid setups.
- No files require special attention
<sub>Last reviewed commit: 9f67e26</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#14944: fix(browser): prefer openclaw profile in headless/noSandbox environ...
by BenediktSchackenberg · 2026-02-12
69.7%
#13568: Fix browser (OpenClaw-managed) launch fail by binding remote debugg...
by singlag · 2026-02-10
68.9%
#19223: fix: add WSL2 Windows browser detection for Linux platform
by MisterGuy420 · 2026-02-17
67.6%
#17760: fix(browser): rewrite 0.0.0.0 and [::] wildcard addresses in CDP We...
by joeharouni · 2026-02-16
66.7%
#19495: fix: handle Chrome process re-parenting on Windows
by andenwick · 2026-02-17
65.9%
#22952: fix(browser): suggest remote profile when local Chrome is not insta...
by dashed · 2026-02-21
65.8%
#8614: fix(browser): detect early chromium exit to prevent startup hang
by Wren-OC · 2026-02-04
65.7%
#19823: fix(browser): stability improvements for headless Chrome
by Milofax · 2026-02-18
64.9%
#22997: fix(browser): remove stale Chrome SingletonLock before launch
by CryptoYogiLLC · 2026-02-21
64.5%
#11692: feat: add standalone browser CLI for Linux users
by shipitirl · 2026-02-08
64.5%