Skip to content

fix(linux): keep the user's --enable/--disable-features on Wayland - #1453

Merged
EtienneLescot merged 1 commit into
mainfrom
pilot/fix-1452
Oct 31, 2026
Merged

EtienneLescot merged 1 commit into
mainfrom
pilot/fix-1452

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Refs #1452

What this fixes
On a Wayland session, configureWaylandSupport appends enable-features and disable-features. Chromium keeps only the last value of a repeated switch (base::CommandLine::AppendSwitchNative overwrites switches_[key], and Electron's InitializeFeatureList reads that single value), so any --enable-features= / --disable-features= the user passed was silently dropped. That is why the reporter's --disable-features=WebRtcPipeWireCamera "had no effect". The switches are now merged with what is already there.

What it does not prove
This is not a confirmed fix for the missing camera itself. In Electron 41 (Chromium 146.0.7680.188), kWebRtcPipeWireCamera is disabled by default, so cameras are enumerated through V4L2 on Wayland exactly as on X11; the PipeWire portal theory does not hold by default. With this change, a user can at least try --enable-features=WebRtcPipeWireCamera and get a real answer.

Tests

  • electron/wayland.test.ts: new case for feature lists already on the command line.
  • Not tested on a real Wayland machine: the Linux test box was unreachable.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved startup behavior in Wayland sessions by retaining existing browser feature settings when applying Wayland-related configuration. This helps prevent previously configured features from being unintentionally overridden.

Chromium keeps only the last value of a repeated switch, so the Wayland
setup silently replaced any feature list passed on the command line.
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5b35b4bd-f433-4e7c-b52a-2d5878dd27e0
Commits

Reviewing files that changed from the base of the PR and between 5ae165e and 317eaaa.

Files selected for processing: 2
  • electron/wayland.test.ts
  • electron/wayland.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

Wayland configuration now preserves existing enable-features and disable-features values when adding Wayland features and Vulkan. Tests cover existing values and update command-line mocks to provide getSwitchValue.

Changes: Wayland feature switches

Layer / File(s) Summary
Append Wayland features to existing values
electron/wayland.ts, electron/wayland.test.ts
CommandLine now includes getSwitchValue. Wayland configuration appends requested features to existing switch values, or uses the requested features when a value is empty. Tests check that existing enabled and disabled features are retained. Mocks provide getSwitchValue.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • Issue 1452 reports that OpenScreen cannot enumerate cameras on Ubuntu Wayland. This change retains existing feature values and adds WebRTCPipeWireCapturer, but it does not establish that camera enumeration is fixed.

Suggested reviewers: mcmah309

Merge Risk: Minimal · up to 317ea

The change retains user-provided feature flags during Wayland setup. No actionable merge-blocking issue is identified; real-machine Wayland validation remains unreported.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the change, related issue, limitation, and testing. However, it omits the required template headings and selections for Summary, Type of change, Release impact, Desktop impact… Rewrite the description using the repository template. Add the required headings, select the applicable change, release, and desktop impact options, and place the testing details under the Testing section. Keep the existing technical explan…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preserving user-provided enable and disable feature switches on Wayland.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.

Full details: Description check

Explanation

The description explains the change, related issue, limitation, and testing. However, it omits the required template headings and selections for Summary, Type of change, Release impact, Desktop impact, Screenshots / video, and Testing.

Resolution

Rewrite the description using the repository template. Add the required headings, select the applicable change, release, and desktop impact options, and place the testing details under the Testing section. Keep the existing technical explanation and issue reference.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@EtienneLescot
EtienneLescot merged commit bfd5bc3 into main Oct 31, 2026
20 checks passed
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.

1 participant