fix: let the webcam preview bubble cross monitor boundaries while dragging - #7
Open
Alfredoalv13 wants to merge 1 commit into
Open
fix: let the webcam preview bubble cross monitor boundaries while dragging#7Alfredoalv13 wants to merge 1 commit into
Alfredoalv13 wants to merge 1 commit into
Conversation
…gging The floating camera preview bubble had the same single-display limitation the HUD control bar had before #4: its drag math clamped to window.innerWidth/innerHeight (one display's work area) with no way to hop onto a second monitor. Applies the same fix as #4 - track a fixed grab offset instead of a client-coordinate snapshot, compute the target position in absolute screen coordinates so it stays correct if the HUD window relocates mid-drag, and re-measure the bubble's actual rendered rect every frame so a mid-drag window resize is absorbed automatically. Reuses the existing hudOverlayRelocateToPoint IPC call (same window as the HUD bar) with no main-process changes needed.
Owner
Author
Internal bug-hunter reviewReviewed against the reference implementation (useHudBarDrag.ts, merged in #4) with focus on what's different in this port: the drag-threshold gating, the unconditional pointerUp recompute, external consumers of the ref's shape, and the two independent relocate in-flight guards. No confirmed bugs. Summary:
One pre-existing, out-of-scope note: the unmount cleanup effect doesn't null Ready for your manual verification (drag the bubble across a real second monitor) before merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
window.innerWidth/innerHeight(one display's work area), so it could never be dragged onto a second monitor.event.screenX/screenYminuswindow.screenX/screenY) so it stays correct even if the HUD window relocates mid-drag, and re-measure the bubble's actual rendered rect every frame so any mid-drag window resize is absorbed automatically instead of causing a jump.hudOverlayRelocateToPointIPC call — the webcam bubble renders inside the same HUD overlay window as the control bar, so no main-process changes are needed here.Why
Confirmed by reading the code: PR #4 only touched
useHudBarDrag.ts(the control bar). This hook (useWebcamPreviewOverlay.ts) has its own, separate drag implementation with the identical bug and no relocate mechanism at all.Test plan
npx tsc— cleannpx vitest --run— 786/786 passingnpx biome checkon the changed file — clean (one pre-existing, unrelated formatting issue onmainleft untouched)