Skip to content

Fix HUD overlay blocking the screen while recording - #845

Open
datasciritwik wants to merge 1 commit into
webadderallorg:mainfrom
datasciritwik:fix/hud-overlay-blocks-screen-while-recording
Open

Fix HUD overlay blocking the screen while recording#845
datasciritwik wants to merge 1 commit into
webadderallorg:mainfrom
datasciritwik:fix/hud-overlay-blocks-screen-while-recording

Conversation

@datasciritwik

@datasciritwik datasciritwik commented Aug 28, 2026

Copy link
Copy Markdown

Problem

While a recording is active, the HUD overlay becomes a large, real window sitting over the screen. In practice this means:

  • The macOS window picker (Cmd+Shift+5) highlights and selects the HUD instead of the window behind it, so that region of the screen can't be captured while recording.
  • Any moment the renderer legitimately holds the mouse (hovering the bar or the webcam preview), the entire block swallows clicks rather than just the visible controls — the app being recorded becomes unreachable behind it.
  • The floating webcam preview can only be dragged within that block, since it's positioned by a CSS transform inside the overlay window.

Cause

getHudOverlayBounds() passed this as the "passthrough supported" argument:

isHudOverlayMousePassthroughSupported() && !hudOverlayRecordingActive

On macOS and Windows that evaluates to false during recording, so the HUD is handed the fallback geometry — a fixed 860×540 (or 160px compact) block intended for platforms that cannot make the overlay click-through at all.

Meanwhile setHudOverlayMousePassthrough() uses the real platform check, so the window ends up with fallback bounds but passthrough-style mouse handling. The two paths disagree about which mode the overlay is in.

Fix

Whether the overlay can pass clicks through is a property of the platform, not of whether a recording is in progress — so use the platform check alone.

Platforms without passthrough support (Linux) keep the fallback geometry exactly as before. This only changes the recording case on platforms that already use a click-through overlay when idle.

Verification

npm test — 1022 tests pass. tsc --noEmit and biome check clean.

Verified on macOS 15 (arm64) with a packaged build by instrumenting the overlay window and logging its real state every 500ms during an active recording:

before after
bounds while recording 860×540 block 1710×997 (full work area)
setIgnoreMouseEvents true in 168 / 204 samples

The 36 samples with passthrough off all correspond to the pointer being over the bar or the webcam preview, which is the intended behaviour. Manually confirmed afterwards that the screen behind the HUD is clickable during a recording and the webcam preview can be dragged anywhere on screen.

I couldn't reproduce on Windows or Linux — the code path is shared with macOS on Windows, and Linux is unaffected by construction, but a second pair of eyes on Windows would be welcome.

Summary by CodeRabbit

  • Bug Fixes
    • Improved HUD overlay positioning on platforms without mouse-passthrough support.
    • Ensured fallback window geometry is used consistently, including while recording.

While a recording is active, getHudOverlayBounds() passed
`isHudOverlayMousePassthroughSupported() && !hudOverlayRecordingActive`
as the "passthrough supported" argument. On macOS and Windows this
evaluated to false during recording, so the HUD was given the *fallback*
geometry -- a fixed 860x540 (or 160px compact) block intended for
platforms that cannot make the overlay click-through at all.

That left a large, real window sitting over the screen for the whole
recording:

- The macOS window picker (Cmd+Shift+5) highlighted and selected the HUD
  instead of the window behind it, so that region could not be captured.
- Any moment the renderer legitimately held the mouse (hovering the bar
  or the webcam preview), the entire block swallowed clicks rather than
  just the visible controls.
- The floating webcam preview could only be dragged within that block,
  since it is positioned by a CSS transform inside the overlay window.

Meanwhile setHudOverlayMousePassthrough() used the real platform check,
so the window got fallback bounds with passthrough-style mouse handling
-- the two paths disagreed about which mode the overlay was in.

Whether the overlay can pass clicks through is a property of the
platform, not of whether a recording is in progress, so use the platform
check alone. Platforms without passthrough support keep the fallback
geometry exactly as before; this only affects the recording case on
platforms that already use a click-through overlay when idle.

Verified on macOS 15 (arm64) by instrumenting the overlay window: across
204 samples during an active recording the bounds stayed at the full work
area (1710x997) and setIgnoreMouseEvents was true for 168 of them,
flipping to false only while the pointer was over the bar or the webcam
preview. Before the change that same window was the 860x540 block.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Review 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: Pro Plus

Run ID: 07f9ea6c-f21b-4482-8d8e-b6975a344d8a

📥 Commits

Reviewing files that changed from the base of the PR and between 85e045e and e48e24b.

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

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


📝 Walkthrough

Walkthrough

getHudOverlayBounds now selects fallback geometry based only on platform mouse passthrough support. Recording activity no longer changes this decision on passthrough-capable platforms. A comment documents the behavior.

Changes

HUD overlay bounds

Layer / File(s) Summary
Platform-aware bounds selection
electron/windows.ts
getHudOverlayBounds passes isHudOverlayMousePassthroughSupported() directly to getHudOverlayWindowBounds. The code includes a rationale comment.

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

Merge Risk: 🔵 Low · up to e48e2

The fix removes the large recording-time HUD block on supported platforms, restoring access to the screen behind it. A bounded lifecycle edge case remains: if the HUD is recreated during recording, it may temporarily capture input across the work area and obstruct other applications. The change is mergeable with explicit owner awareness and follow-up to enforce passthrough during recreation.

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 1 functions across 1 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 summarizes the main change: preventing the HUD overlay from blocking the screen during recording.
Description check ✅ Passed The description clearly explains the problem, cause, fix, platform-specific behavior, and verification results. It does not use the template headings and omits the checklist, related issue, and screen…
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: Description check

Explanation

The description clearly explains the problem, cause, fix, platform-specific behavior, and verification results. It does not use the template headings and omits the checklist, related issue, and screenshots or video, but it provides the critical information needed for review.

  • 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.

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