fix: allow clicks to pass through recording control overlay#688
fix: allow clicks to pass through recording control overlay#688tyronedougherty wants to merge 2 commits into
Conversation
The HUD overlay window blocked all clicks in an 860×160 rectangle during recording. Two issues contributed: 1. The pointer-events-auto hit area was on a static wrapper div rather than the transformed element that moves with the dragged controls, so the interactive region never followed the bar. 2. The main process forced the window into compact non-passthrough bounds during recording, disabling the forwarding mechanism that allows clicks to reach apps beneath transparent areas. Move pointer-events-auto and mouse handlers onto the hudBarTransformRef div so the hit area tracks the controls. Keep the window at full work-area bounds during recording on platforms with passthrough support, letting the renderer's hover detection toggle click interception only when the cursor is directly over the control bar. Closes webadderallorg#687 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughHUD overlay mouse passthrough is decoupled from ChangesHUD Mouse Passthrough During Recording
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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)
279-310:⚠️ Potential issue | 🟠 Major | ⚡ Quick winApply the source-selection override to the actual window state.
Line 281 can force
hudOverlayIgnoringMousetotrue, but Lines 299 and 305 still apply the rawignoreargument. When source selection is active andignoreisfalse, the stored state says click-through while the window is made interactive.Proposed fix
function setHudOverlayMousePassthrough(ignore: boolean) { - hudOverlayIgnoringMouse = + const shouldIgnoreMouse = hudOverlaySourceSelectionActive && !hudOverlayRecordingActive ? true : ignore; + hudOverlayIgnoringMouse = shouldIgnoreMouse; if (hudOverlayMouseReassertTimer) { clearTimeout(hudOverlayMouseReassertTimer); @@ if (!isHudOverlayMousePassthroughSupported()) { if (process.platform !== "linux") { - setHudOverlayFallbackExpanded(!ignore); + setHudOverlayFallbackExpanded(!shouldIgnoreMouse); } hudOverlayWindow.setIgnoreMouseEvents(false); return; } - if (ignore) { + if (shouldIgnoreMouse) { hudOverlayWindow.setIgnoreMouseEvents(true, { forward: true }); return; }🤖 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 279 - 310, The setHudOverlayMousePassthrough function computes the correct mouse passthrough state and stores it in hudOverlayIgnoringMouse on line 281, but then uses the raw ignore parameter instead of this computed state when calling hudOverlayWindow.setIgnoreMouseEvents at lines 299 and 305. Replace the raw ignore parameter with hudOverlayIgnoringMouse (or its appropriate negation) when setting the window's ignore mouse events state to ensure the window behavior matches the stored state, especially when source selection is active.
🤖 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 607-609: In the reassertHudOverlayMouseState() function, the
recording path (when hudOverlayRecordingActive is true) currently forces
setIgnoreMouseEvents(true, { forward: true }) which ignores the stored
hudOverlayIgnoringMouse state. Replace this forced click-through behavior with a
call to setHudOverlayMousePassthrough() that reapplies the stored state,
matching the pattern used in the non-recording path at line 621, so the
main-process mouse state stays synchronized with the renderer's actual hover
state over controls.
---
Outside diff comments:
In `@electron/windows.ts`:
- Around line 279-310: The setHudOverlayMousePassthrough function computes the
correct mouse passthrough state and stores it in hudOverlayIgnoringMouse on line
281, but then uses the raw ignore parameter instead of this computed state when
calling hudOverlayWindow.setIgnoreMouseEvents at lines 299 and 305. Replace the
raw ignore parameter with hudOverlayIgnoringMouse (or its appropriate negation)
when setting the window's ignore mouse events state to ensure the window
behavior matches the stored state, especially when source selection is active.
🪄 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: 0fe46ee8-2aac-40c9-81b4-04643c018614
📒 Files selected for processing (2)
electron/windows.tssrc/components/launch/LaunchWindow.tsx
Instead of forcing setIgnoreMouseEvents(true, { forward: true }) during
recording, reapply the stored hudOverlayIgnoringMouse state so the main
process stays in sync with the renderer's hover state.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
pointer-events-autoand mouse enter/leave handlers from the static wrapper div onto thehudBarTransformRefelement that moves with the dragged recording controls, so the interactive hit area follows the barCloses #687
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit