Skip to content

fix: drag the self-timer HUD with the native window drag - #407

Merged
lzhgus merged 1 commit into
mainfrom
fix/self-timer-hud-drag
Nov 17, 2026
Merged

lzhgus merged 1 commit into
mainfrom
fix/self-timer-hud-drag

Conversation

@lzhgus

@lzhgus lzhgus commented Nov 17, 2026

Copy link
Copy Markdown
Owner

The self-timer HUD moved itself from a SwiftUI DragGesture in the .global space, which is window-relative: as the window moves, the translation shrinks, so the HUD trails the pointer. Same root cause as the first version of #400.

  • WindowDragHandle (moved to App/Sources/Support) now starts performDrag(with:) once the pointer has moved 4pt, and reports a press that never moved as a tap and the final origin when a drag ends.
  • The HUD uses it as an overlay in place of its drag and tap gestures; click-to-cancel and the remembered position are unchanged. Hover tracking is applied outside the overlay so the cancel glyph still appears.
  • The translation card keeps using .dragsWindow() on its header.

Tested in a Debug build:

  • HUD drag follows the pointer 1:1 and the new position is saved and restored on the next countdown
  • a click, and a click with a 2pt wobble, cancel the countdown
  • hovering shows the cancel glyph
  • translation card: header drag 1:1 (also as the first press with another app frontmost), body does not drag, close button works

🤖 Generated with Claude Code

The HUD moved itself from a SwiftUI DragGesture measured in window
coordinates, so it trailed the pointer. It now shares the translation card's
drag handle, which starts the native window drag once the pointer moves and
reports a press that never moved as a tap, so click-to-cancel and the saved
position keep working.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@lzhgus
lzhgus merged commit aba1f64 into main Nov 17, 2026
5 checks passed
@lzhgus
lzhgus deleted the fix/self-timer-hud-drag branch November 17, 2026 06:18
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