Skip to content

Run non-headless Chrome on X11 on Linux instead of Wayland. - #28405

Open
juj wants to merge 1 commit into
emscripten-core:mainfrom
juj:chrome-linux-x11-ozone
Open

juj wants to merge 1 commit into
emscripten-core:mainfrom
juj:chrome-linux-x11-ozone

Conversation

@juj

@juj juj commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

On Linux, Chrome runs on Wayland by default when a Wayland session is detected. On Wayland, the compositor marks windows that are covered by another window as occluded, and Chrome then stops producing frames (and requestAnimationFrame() callbacks) for them. When the browser tests run in parallel, each browser instance has its own window, and all but the topmost one of them is occluded, which makes timing-sensitive tests flaky (e.g. browser.test_glgears_animation).

Running Chrome with --ozone-platform=x11 (i.e. on XWayland) avoids this behavior: occluded windows keep producing frames at the full frame rate.

The flag is only added for non-headless runs, since headless mode does not use a desktop platform.

On Linux, Chrome runs on Wayland by default when a Wayland session is
detected. On Wayland, the compositor marks windows that are covered by
another window as occluded, and Chrome then stops producing frames (and
requestAnimationFrame() callbacks) for them. When the browser tests run
in parallel, each browser instance has its own window, and all but the
topmost one of them is occluded, which makes timing-sensitive tests
flaky (e.g. browser.test_glgears_animation).

Running Chrome with --ozone-platform=x11 (i.e. on XWayland) avoids this
behavior: occluded windows keep producing frames at the full frame rate.

The flag is only added for non-headless runs, since headless mode does
not use a desktop platform.
@juj
juj force-pushed the chrome-linux-x11-ozone branch from cbc389d to 0e015ec Compare November 25, 2026 17:19
Comment thread test/browser_common.py
# On Linux, use X11 (XWayland) instead of Wayland for non-headless
# runs. On Wayland, Chrome stops producing requestAnimationFrame()s
# even when the disable occlusion checking flags are specified.
EMTEST_BROWSER += ' --ozone-platform=x11'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Most linux users are on Wayland, so this change worries me a little.

Don't our other settings already prevent the problem of no rendering when occluded?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, that was the core observation here.. after landing the no-occlusion-tracking flags, Windows and macOS Chrome runs passed, but Linux runner still fails on the test_glgears_animation test variants, since that behavior still takes place.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This sounds like a bug on Linux, if the chrome flags are not having the right effect, is there one filed?

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants