fix: disable WebRTCPipeWireCapturer on XWayland; add Wayland audit and ADR-016#2225
fix: disable WebRTCPipeWireCapturer on XWayland; add Wayland audit and ADR-016#2225IsmaelMartinez wants to merge 7 commits intomainfrom
Conversation
Comprehensive analysis of all Wayland-specific workarounds in the codebase, their continued necessity given Electron 38-40 changes, and per-flag recommendations. Key finding: WebRTCPipeWireCapturer flag is redundant (default since Chromium 110) and can be removed. https://claude.ai/code/session_01VsfQXFDXjgZA6tPnXviwjC
Summary of ChangesHello @IsmaelMartinez, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces detailed research findings regarding the project's Wayland-specific workarounds. It evaluates the continued necessity of several flags, identifies one for immediate removal due to redundancy, and outlines a strategic path for future native Wayland migration as upstream issues are resolved. The audit also provides insights into the camera/mic crash reported in Issue #2221, suggesting it may not be directly related to Wayland. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
✅ Changelog entry generated and committed to this PR: The file You can edit it directly in this PR if needed. |
📦 PR Build Artifacts✅ Build successful! Download artifacts: 🐧 Linuxx86_64 (435.66 MB) - Contains: .deb, .rpm, .tar.gz, .AppImage arm64 (426.87 MB) - Contains: .deb, .rpm, .tar.gz, .AppImage armv7l (404.93 MB) - Contains: .deb, .rpm, .tar.gz, .AppImage 🍎 macOSx86_64 (125.28 MB) - Contains: .dmg 🪟 Windowsx86_64 (105.74 MB) - Contains: .exe installer 📝 Note: Snap packages (.snap) are built in a separate workflow 🕐 Last updated: 2026-02-24 00:25 UTC |
📦 PR Snap Build Artifacts✅ Snap builds successful! Download artifacts: 🐧 Linux Snap Packagesx86_64 (107.69 MB) arm64 (104.61 MB) armv7l (98.83 MB) 📝 Note: Other package formats (.deb, .rpm, .AppImage, .dmg, .exe) are built in the main workflow |
There was a problem hiding this comment.
Code Review
The pull request introduces a comprehensive audit of Wayland optimizations and workarounds, documenting their necessity and providing recommendations. It also updates the README.md to include this new research document. The audit identifies an immediate cleanup opportunity by removing a redundant WebRTCPipeWireCapturer flag and outlines a medium-term migration path for native Wayland support. The documentation is well-structured and provides valuable insights into the project's Wayland strategy.
Cross-references #2217 (screen sharing) and #2169 (camera) as a direct conflict that cannot be solved by toggling --use-fake-ui-for-media-stream. Adds research for session.setDisplayMediaRequestHandler() as the proper fix. Also links #2222 (microphone), #2204 (thumbnail), and #2107 (MQTT) as related open issues affected by the same underlying flag conflict.
…tigation Deep investigation revealed the handler is already implemented at mainAppWindow/index.js:264. Screen sharing still breaks on XWayland without --use-fake-ui-for-media-stream because desktopCapturer.getSources() returns empty — the flag provides PipeWire portal auth that getSources() needs, not just dialog suppression. Root cause of #2169 clarified: permission persistence corruption across sessions (first launch works after clearing Local Storage, subsequent launches fail), not a constant GPU failure. These two issues directly contradict each other — no known API resolves both simultaneously. Updated status from "Ready for Implementation" to investigation-needed. Added historical complications, 5 options analysis, and concrete next steps. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Key corrections from multi-agent review: - Confirm root cause via Chromium source: DesktopCapturer::IsRunningUnderWayland() checks XDG_SESSION_TYPE/WAYLAND_DISPLAY independently of --ozone-platform - Add Option F: --disable-features=WebRTCPipeWireCapturer when isX11Forced as the most targeted fix (short-circuits PipeWire before env var check) - Fix investigation step 1 location: getSources() failure is in service.js #handleGetDesktopCapturerSources, not handleScreenSourceSelection - Document sendScreenSharingStarted(null) preload guard bug dropping IPC events - Fix audit Near-Term Priority: setDisplayMediaRequestHandler already exists; --disable-features=WebRTCPipeWireCapturer is the correct next step - Soften #2222 characterization to require debug logs rather than speculation - Note PR #2207 (redundant getSources() removal) as correct complementary fix - Add Chromium source and Electron upstream issue references Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Combines set-display-media-request-handler-research.md into wayland-optimizations-audit.md for a single cohesive document covering both the per-flag audit and the deep dive into the #2169 vs #2217 conflict. The two files cross-referenced each other constantly — merging removes the split context and makes the investigation flow naturally from the flag inventory through root cause analysis to options and next steps. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…#2217) DesktopCapturer::IsRunningUnderWayland() in Chromium selects the PipeWire capture backend based on XDG_SESSION_TYPE/WAYLAND_DISPLAY independently of --ozone-platform. Under XWayland both env vars remain set, so PipeWire is selected and portal auth is required before getSources() returns sources. Without --use-fake-ui-for-media-stream the auth never happens and getSources() returns empty — causing the empty screen picker in #2217. Explicitly disabling WebRTCPipeWireCapturer when isX11Forced short-circuits the PipeWire backend selection before the env var check, forcing the X11 screengrab path. Camera/mic permissions are unaffected. Removes the dead-code WebRTCPipeWireCapturer enable block (default since Chromium 110, expired M120). Also adds ADR-016 documenting all Wayland flag decisions and their rationale. Fixes #2217 Ref: #2169, ADR-016 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|



Summary
wayland-optimizations-audit.md: merged per-flag audit + deep-dive into the screen sharing vs camera conflictThe Fix (Option F)
Chromium's
DesktopCapturer::IsRunningUnderWayland()selects the PipeWire capture backend by checkingXDG_SESSION_TYPEandWAYLAND_DISPLAY— with zero coupling to--ozone-platform. Under XWayland, both env vars remain set, so PipeWire is selected and xdg-desktop-portal authorization is required beforedesktopCapturer.getSources()returns any sources. Without--use-fake-ui-for-media-streamproviding that auth,getSources()returns empty silently — causing the empty screen picker in #2217.Explicitly disabling
WebRTCPipeWireCapturerwhenisX11Forcedshort-circuits the PipeWire backend selection before the env var check. This forces the X11 screengrab path on XWayland, makinggetSources()return results without portal authorization. Camera and mic permissions are unaffected — this flag only controls the screen capture backend, not thegetUserMedia()permission path.app/startup/commandLine.jschanges:WebRTCPipeWireCapturerenable block (default since Chromium 110, expired at M120)isX11Forced: disablesWebRTCPipeWireCapturer, merged into the existingdisable-featuresvalue (preservingHardwareMediaKeyHandling)--use-fake-ui-for-media-streamas beforeVerified:
app.commandLine.appendSwitchwrites to a map with last-write-wins semantics.InitializeFeatureList()reads the map once at startup. The read-merge-write pattern correctly combines both features into a singledisable-featuresvalue.Note: This is theoretically sound (confirmed via Chromium source) but needs validation on real XWayland hardware. Treating as a candidate fix pending test.
Documentation
wayland-optimizations-audit.md: merges the previous separate research doc into a single document covering the flag inventory, root cause analysis (withIsRunningUnderWayland()source), historical complications, options A–F, and next stepsADR-016: records the rationale for each Wayland flag — XWayland forcing, GPU auto-disable,WebRTCPipeWireCapturerdisable on XWayland,--use-fake-ui-for-media-streamfor native Wayland only,HardwareMediaKeyHandlingdisableRelated Issues
Fixes #2217 (screen sharing broken on XWayland — pending hardware validation)
Preserves fix for #2169 (camera broken on XWayland)
Related: #2221, #2222, #2204, #2107
Known Remaining Issues
sendScreenSharingStarted(null)is silently dropped by the preload guard inapp/browser/preload.js(typeof null !== 'string'), soscreen-sharing-startedIPC never fires from the renderer. MQTT status ([Enhancement]: Publish screen sharing status to MQTT #2107) is likely already broken for thegetDisplayMediapath — separate fix needed.getSources()call) is a correct complementary improvement that should also be reviewed.🤖 Generated with Claude Code