Skip to content

fix(linux): resolve X11 recording overlay input issues#518

Open
dexisback wants to merge 1 commit into
webadderallorg:mainfrom
dexisback:linux-x11-fixes
Open

fix(linux): resolve X11 recording overlay input issues#518
dexisback wants to merge 1 commit into
webadderallorg:mainfrom
dexisback:linux-x11-fixes

Conversation

@dexisback
Copy link
Copy Markdown
Contributor

@dexisback dexisback commented May 15, 2026

Description

Fixes Linux/X11 recording usability issues caused by the fullscreen transparent HUD overlay behavior.

Motivation

On Linux/X11, the transparent fullscreen HUD overlay could intercept pointer input across the entire screen during recording.

This caused:

  • Mouse clicks outside the HUD to stop working
  • Dropdown menus to become clipped or partially inaccessible
  • Inconsistent Linux/Wayland desktop capture startup behavior

The issue was reproducible on Linux Mint (X11).

Type of Change

  • Bug Fix

Related Issue(s)

N/A

Screenshots / Video

fixed.1.mp4

Before

  • Fullscreen transparent overlay intercepted clicks outside the HUD
  • Some HUD dropdowns were clipped

After

  • Recording works normally on Linux/X11
  • Mouse interaction outside the HUD remains functional
  • HUD controls and dropdowns render correctly

Testing Guide

Environment:

  • Linux Mint
  • X11 session

Test steps:

  1. Run the app with:

    npm run dev
  2. Start a screen recording

  3. Verify:

    • Mouse clicks outside the HUD continue working
    • Recording starts successfully
    • HUD dropdowns render correctly
    • Windows/macOS behavior remains unchanged

Implementation Notes

Linux-specific HUD bounds

Linux now uses compact HUD overlay bounds instead of a fullscreen transparent overlay window.

This avoids X11 compositors treating the overlay as a fullscreen input-intercepting window.

Platform-specific mouse forwarding

Linux now avoids:

setIgnoreMouseEvents(true, { forward: true })

while preserving the existing behavior for Windows/macOS.

Wayland portal handling

Improves Linux portal sentinel detection by ensuring the fallback path only applies on Wayland sessions.

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

Summary by CodeRabbit

  • Bug Fixes
    • Improved screen capture reliability on Linux systems running Wayland through enhanced detection logic and identification of available capture sources
    • Optimized HUD overlay positioning and mouse event handling on Linux with improved interaction and responsiveness

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

📝 Walkthrough

Walkthrough

This PR refines Linux/Wayland support across screen capture and HUD overlay features. The display media handler now gates portal sentinel detection on the Wayland session type, and the HUD overlay gains Linux-specific sizing, positioning, and mouse passthrough behavior.

Changes

Linux Platform Support Refinements

Layer / File(s) Summary
Linux/Wayland screen capture portal detection
electron/main.ts
The display media request handler's "Linux portal sentinel" check now additionally gates on XDG_SESSION_TYPE === "wayland", controlling when a synthetic "Entire screen" capture is returned without calling desktopCapturer.getSources().
HUD overlay sizing, positioning, and mouse interaction on Linux
electron/windows.ts
getHudOverlayBounds() returns fixed 520×220 bounds positioned near bottom-center on Linux (vs. full work area on other platforms); hud-overlay-set-ignore-mouse IPC handler calls setIgnoreMouseEvents(true) without the forward option on Linux, while other platforms retain { forward: true }.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • webadderallorg/Recordly#269: Both PRs refine the Linux/Wayland portal sentinel logic in electron/main.ts's setDisplayMediaRequestHandler to control when synthetic capture sources are returned.
  • webadderallorg/Recordly#207: Both PRs modify electron/windows.ts HUD overlay bounds/positioning logic, particularly for Linux-specific layout.
  • webadderallorg/Recordly#157: Both PRs modify the hud-overlay-set-ignore-mouse IPC handler in electron/windows.ts, specifically Linux-specific setIgnoreMouseEvents() behavior.

Suggested labels

Checked

Poem

🐰 A portal's sentinel stands guard on Wayland's shore,
While HUD overlays find their place with Linux lore.
Mouse events drift through with tailored care,
Platform-perfect paths bloom everywhere! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main fix: resolving X11 recording overlay input issues on Linux, which matches the core changes in both electron/main.ts and electron/windows.ts.
Description check ✅ Passed The description is comprehensive and well-structured, covering motivation, type of change, testing guide, implementation details, and completing the provided template requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
electron/windows.ts (1)

259-271: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

The new Linux passthrough branch is unreachable.

Line 261 returns early whenever isHudOverlayMousePassthroughSupported() is false, and that helper hard-codes false on Linux at Line 119. That means Lines 267-270 never run, get-hud-overlay-mouse-passthrough-supported still reports unsupported, and the HUD stays in setIgnoreMouseEvents(false) on Linux.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@electron/windows.ts` around lines 259 - 271, The handler for
"hud-overlay-set-ignore-mouse" returns early when
isHudOverlayMousePassthroughSupported() is false, which prevents the
Linux-specific branch from running; change the logic so we don't return early
but instead call hudOverlayWindow.setIgnoreMouseEvents(true) for Linux and, for
other platforms, call setIgnoreMouseEvents(true, { forward: true }) only when
isHudOverlayMousePassthroughSupported() is true (otherwise call
setIgnoreMouseEvents(true) as a safe fallback); update the ipcMain.on handler
around isHudOverlayMousePassthroughSupported(), the ignore-branch that currently
branches on process.platform === "linux", and the fallback
setIgnoreMouseEvents(false) call so Linux path is reachable and
get-hud-overlay-mouse-passthrough-supported reflects actual behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@electron/windows.ts`:
- Around line 188-197: The Linux branch always recenters the HUD ignoring
hudUserPosition—preserve and reuse the saved position when valid. In the Linux
branch (where width/height are set) check if hudUserPosition exists and is
within the current workArea bounds (clamp if necessary), and return bounds using
hudUserPosition.x/hudUserPosition.y with the computed width/height instead of
forcing center; otherwise fall back to the centered x/y. Ensure this fixes
subsequent applyHudOverlayBounds() calls by returning the persisted position
when present.

---

Outside diff comments:
In `@electron/windows.ts`:
- Around line 259-271: The handler for "hud-overlay-set-ignore-mouse" returns
early when isHudOverlayMousePassthroughSupported() is false, which prevents the
Linux-specific branch from running; change the logic so we don't return early
but instead call hudOverlayWindow.setIgnoreMouseEvents(true) for Linux and, for
other platforms, call setIgnoreMouseEvents(true, { forward: true }) only when
isHudOverlayMousePassthroughSupported() is true (otherwise call
setIgnoreMouseEvents(true) as a safe fallback); update the ipcMain.on handler
around isHudOverlayMousePassthroughSupported(), the ignore-branch that currently
branches on process.platform === "linux", and the fallback
setIgnoreMouseEvents(false) call so Linux path is reachable and
get-hud-overlay-mouse-passthrough-supported reflects actual behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4fb0c7cf-0e4d-48f4-8e83-8d8a91e9689a

📥 Commits

Reviewing files that changed from the base of the PR and between 7bc06c9 and 81f8a9c.

📒 Files selected for processing (2)
  • electron/main.ts
  • electron/windows.ts

Comment thread electron/windows.ts
Comment on lines +188 to +197
if (process.platform === "linux") {
const width = 520;
const height = 220;

return {
width,
height,
x: Math.round(workArea.x + (workArea.width - width) / 2),
y: workArea.y + workArea.height - 240,
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Preserve the dragged HUD position before recentering on Linux.

This branch always recenters the HUD and ignores hudUserPosition, so any later applyHudOverlayBounds() call snaps a dragged HUD back to bottom-center even when the saved position is still valid.

Suggested fix
 	if (process.platform === "linux") {
 		const width = 520;
 		const height = 220;
+
+		if (hudUserPosition) {
+			return {
+				x: hudUserPosition.x,
+				y: hudUserPosition.y,
+				width,
+				height,
+			};
+		}
 
 		return {
 			width,
 			height, 
 			x: Math.round(workArea.x + (workArea.width - width) / 2),
 			y: workArea.y + workArea.height - 240,
 		};
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@electron/windows.ts` around lines 188 - 197, The Linux branch always
recenters the HUD ignoring hudUserPosition—preserve and reuse the saved position
when valid. In the Linux branch (where width/height are set) check if
hudUserPosition exists and is within the current workArea bounds (clamp if
necessary), and return bounds using hudUserPosition.x/hudUserPosition.y with the
computed width/height instead of forcing center; otherwise fall back to the
centered x/y. Ensure this fixes subsequent applyHudOverlayBounds() calls by
returning the persisted position when present.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant