Skip to content

fix(hud): keep pointer interaction when recording starts - #1162

Open
lincoo2019 wants to merge 1 commit into
webadderallorg:mainfrom
lincoo2019:fix/hud-stop-click-passthrough
Open

lincoo2019 wants to merge 1 commit into
webadderallorg:mainfrom
lincoo2019:fix/hud-stop-click-passthrough

Conversation

@lincoo2019

@lincoo2019 lincoo2019 commented Oct 25, 2026 •

Copy link
Copy Markdown

Problem

On Windows, after pressing Record, the HUD overlay could become unresponsive: the timer kept counting and the native capture (wgc-capture.exe) kept recording, but clicking the stop button did nothing, so the only way out was to kill the app.

Root cause

The HUD is a full-window transparent overlay whose interactivity is driven by the renderer: it receives forwarded pointer moves, and calls hud-overlay-set-ignore-mouse(false) only while the pointer is over an interactive element.

setHudOverlayRecordingActive() unconditionally forced passthrough when the recording state changed:

setHudOverlayMousePassthrough(true);

This ran right after the user pressed Record, i.e. while the pointer was still sitting on the HUD bar. The window switched to click-through even though the renderer had just reported "interactive", so the next click — targeting the stop button, which appears almost exactly where the record button was — fell through to the window underneath. Since the pointer never moved, no new mouseover arrived to restore interaction, and the HUD stayed click-through for the rest of the recording.

Measured on Windows 11 while the bug was reproduced: mousemove/mouseover events were still forwarded to the renderer (345/30), but mousedown was never delivered (0), and the HUD window kept WS_EX_TRANSPARENT.

Fix

Keep the hover state the renderer last reported instead of forcing passthrough:

setHudOverlayMousePassthrough(hudOverlayIgnoringMouse);
  • Pointer over the HUD when recording starts → it stays interactive, so the stop button can be clicked immediately.
  • Recording started via shortcut/tray with the pointer elsewhere → hudOverlayIgnoringMouse is already true, so behaviour is unchanged.
  • Click-through is still restored by the existing mouseleave/mouseover logic as soon as the pointer leaves the bar.

Test plan

  • Manual repro on Windows 11 (native WGC capture, microphone + system audio, 3 s countdown): press Record with the pointer on the button, keep the pointer still, wait for the recording to start, then click the same spot to stop.
    • Before: click is swallowed, recording keeps running.
    • After: stop is registered and the editor opens.
  • No automated test was added because this touches Electron window-level mouse passthrough and requires an interactive desktop session.

Summary by CodeRabbit

  • Bug Fixes
    • The HUD now preserves its mouse interaction behavior when recording status changes.

Forcing HUD mouse passthrough on the recording state change made the overlay click-through right after the user pressed Record. The stop button lands almost where the record button was, so the next click fell through to the window below: the timer kept running but the HUD ignored clicks and the native capture could not be stopped. Preserve the hover state reported by the renderer instead, and let the existing mouseleave logic restore passthrough when the pointer leaves the bar.
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 109ca3a and ba3a4d5.

Files selected for processing: 1
  • electron/windows.ts

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

Walkthrough

When the HUD recording state changes, the code now reapplies the stored mouse-passthrough state instead of always enabling passthrough.

Changes: HUD mouse state

Layer / File(s) Summary
Preserve passthrough state
electron/windows.ts
setHudOverlayRecordingActive now passes the stored hudOverlayIgnoringMouse value to setHudOverlayMousePassthrough.

Priority: Normal

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

Change: Bug fix

Possibly related issues

Possibly related PRs

  • webadderallorg/Recordly#1160: This PR tests HUD pointer interactions; this change preserves the passthrough state that affects those interactions.

Suggested reviewers: webadderall

Merge Risk: Minimal · up to ba3a4

The focused HUD state-preservation change is mergeable.

Pre-merge checks: Passed 4 · Failed 1

Failed 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 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary fix: preserving HUD pointer interaction when recording starts.
Description check Passed The description clearly explains the problem, root cause, fix, expected behavior, and manual test plan. It does not use the template headings and omits the type checklist, related issue, screenshots o…
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, root cause, fix, expected behavior, and manual test plan. It does not use the template headings and omits the type checklist, related issue, screenshots or video, and contributor checklist, but the required change context and testing information are mostly complete.

Finishing Touches
🧪 Generate unit tests (beta)
  • 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

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant