Skip to content

fix(linux): restore X11 screen capture on v1.4.0 - #905

Open
he1acdvv wants to merge 1 commit into
webadderallorg:mainfrom
he1acdvv:fix/linux-x11-v1.4.0
Open

fix(linux): restore X11 screen capture on v1.4.0#905
he1acdvv wants to merge 1 commit into
webadderallorg:mainfrom
he1acdvv:fix/linux-x11-v1.4.0

Conversation

@he1acdvv

@he1acdvv he1acdvv commented Sep 8, 2026

Copy link
Copy Markdown

Summary

Fix Linux X11 recording startup on v1.4.0 without changing the Wayland capture path.

  • Detect the active Linux window system through IPC.
  • Keep screen:linux-portal on Wayland only.
  • Resolve a live Electron desktopCapturer screen source on X11, including when an old portal sentinel was saved.
  • Let Electron 43 choose its working ANGLE backend instead of forcing --use-gl=egl.
  • Restore the screen/window picker on X11 and allow the Linux HUD to expand so its popover is not clipped.

Existing webcam, microphone, system audio, editor, and cursor behavior is otherwise unchanged. The webcam popover still supports turning the webcam off.

Prior work

This is a focused v1.4.0 patch based on the X11 source-selection work discussed in #768 and #678, plus the Electron GPU and Wayland/X11 routing fixes from #705 and #842.

It intentionally does not include the larger native FFmpeg X11 backend from #842 or unrelated changes from those branches.

Verification

  • npm install
  • npx tsc --noEmit
  • npx vitest --run electron/gpuSwitches.test.ts electron/ipc/register/sourceMapping.test.ts electron/hudOverlayBounds.test.ts src/hooks/useScreenRecorder.test.ts (84 tests passed)
  • npm run build:linux
  • AppImage produced at release/Recordly-linux-x64.AppImage

Summary by CodeRabbit

  • Bug Fixes

    • Improved Linux screen sharing and recording source selection for Wayland and X11.
    • X11 now selects an available live screen instead of using the Linux portal fallback.
    • Wayland continues using the portal-based capture flow.
    • Corrected screen-source matching and fallback behavior during display capture.
    • Improved HUD overlay mouse passthrough behavior on Linux.
  • Improvements

    • Screen-source controls are now available on Linux X11 while remaining hidden where unsupported.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 2ae66fcb-bd69-40a2-afcd-4c622b42697e

📥 Commits

Reviewing files that changed from the base of the PR and between 4b20a1a and 109f5e2.

📒 Files selected for processing (11)
  • electron/gpuSwitches.test.ts
  • electron/gpuSwitches.ts
  • electron/ipc/register/settings.ts
  • electron/ipc/register/sourceMapping.test.ts
  • electron/ipc/register/sourceMapping.ts
  • electron/main.ts
  • electron/windows.ts
  • src/components/launch/LaunchWindow.tsx
  • src/components/launch/hooks/useLaunchWindowSystemState.ts
  • src/hooks/useScreenRecorder.test.ts
  • src/hooks/useScreenRecorder.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds Linux Wayland and X11 detection, routes portal and screen capture sources by window system, exposes the result to launch UI controls, stops forcing EGL on Linux, and updates Linux HUD fallback handling.

Changes

Linux capture routing

Layer / File(s) Summary
Window-system detection and IPC
electron/ipc/register/sourceMapping.ts, electron/ipc/register/settings.ts, electron/ipc/register/sourceMapping.test.ts
Adds Linux window-system detection, portal-sentinel rules, an IPC handler, and Wayland/X11 tests.
Display media source routing
electron/main.ts
Uses Wayland-only portal sentinel routing and resolves X11 sources through live screen fallbacks.
Recording source resolution
src/hooks/useScreenRecorder.ts, src/hooks/useScreenRecorder.test.ts
Resolves Linux recording sources by window system and tests Wayland, X11, and unavailable-source cases.
Launch-window source controls
src/components/launch/hooks/useLaunchWindowSystemState.ts, src/components/launch/LaunchWindow.tsx
Loads the Linux window system and shows source controls on Linux X11 only.

Linux GPU backend behavior

Layer / File(s) Summary
GPU switch selection
electron/gpuSwitches.ts, electron/gpuSwitches.test.ts
Stops forcing EGL on Linux and updates the X11 expectation.

HUD overlay behavior

Layer / File(s) Summary
HUD passthrough handling
electron/windows.ts
Updates HUD fallback expansion on Linux and other platforms.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 109f5

This restores X11 screen-source selection while retaining Wayland portal routing, removes forced Linux EGL selection, and enables Linux HUD expansion. No concrete merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant LaunchWindow
  participant useLaunchWindowSystemState
  participant ElectronIPC
  participant sourceMapping
  participant useScreenRecorder
  participant desktopCapturer
  LaunchWindow->>useLaunchWindowSystemState: load Linux window system
  useLaunchWindowSystemState->>ElectronIPC: getLinuxWindowSystem()
  ElectronIPC->>sourceMapping: detect Wayland or X11
  sourceMapping-->>ElectronIPC: window-system result
  useScreenRecorder->>desktopCapturer: enumerate X11 screen sources
  desktopCapturer-->>useScreenRecorder: live screen sources
  useScreenRecorder-->>LaunchWindow: resolved recording source
Loading

Suggested reviewers: meiiie, webadderall

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 11 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: restoring Linux X11 screen capture for v1.4.0.
Description check ✅ Passed The description clearly explains the purpose, scope, prior work, and verification steps. It is mostly complete, although it does not use all template sections or include the checklist and screenshots …
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@webadderall

Copy link
Copy Markdown
Collaborator

Thanks for the focused v1.4.0 X11 fix. I reviewed the diff and ran the full suite (1,088 tests), targeted Linux tests, TypeScript, and Biome—all passed.

One merge blocker: the electron/windows.ts change removes the Linux guard around setHudOverlayFallbackExpanded(!ignore). This re-enables dynamic HUD resizing on Wayland, where compositor positioning restrictions cause the bar to move out from under the pointer and enter a hover/resize oscillation. That behavior is documented in #891, and the earlier implementation was reverted in d2796fb.

Could you remove the HUD-resizing hunk from this PR and keep #905 focused on X11 capture/source routing and the GPU switch? #919 provides a Wayland-aware approach to the HUD problem. After that change and an X11 smoke test, this looks like a good merge candidate.

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.

3 participants