Skip to content

[codex] Hide mouse ticks while dragging rulers - #176

Merged
pascalpp merged 2 commits into
mainfrom
codex/175-hide-mouse-ticks-during-drag
Jun 11, 2026
Merged

pascalpp merged 2 commits into
mainfrom
codex/175-hide-mouse-ticks-during-drag

Conversation

@pascalpp

Copy link
Copy Markdown
Owner

Summary

Fixes #175 by keeping mouse ticks suppressed for the full ruler drag gesture.

Root Cause

windowDidMove fires repeatedly while a borderless ruler window is being dragged. Each move notification scheduled the delayed mouse tick resume timer, so a small cursor shake during a drag could let that timer re-enable mouse ticks before the mouse button was released.

Changes

  • Track active ruler dragging in RulerController.
  • Disable mouse ticks on mouse down.
  • Ignore move-triggered resume scheduling while dragging.
  • Schedule the normal delayed tick resume only after mouse up.
  • Add a regression test that simulates move notifications during a drag and verifies ticks stay hidden until release.

Validation

  • xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" -only-testing:FreeRulerTests/RulerCoreTests test
  • xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" test

@pascalpp
pascalpp marked this pull request as ready for review June 11, 2026 02:37
Copilot AI review requested due to automatic review settings June 11, 2026 02:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes #175 by ensuring mouse ticks remain suppressed throughout an entire ruler drag gesture, preventing move notifications from prematurely re-enabling ticks before mouse release.

Changes:

  • Track an active drag gesture in RulerController to suppress tick-resume scheduling during drag-driven windowDidMove callbacks.
  • Disable mouse ticks on mouseDown and only schedule delayed tick resume after mouseUp.
  • Add a regression test to ensure move notifications during a drag do not re-enable ticks until release.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Free Ruler/RulerController.swift Adds drag-state tracking to prevent move-triggered tick resumption during an active drag, resuming only after mouse up.
FreeRulerTests/RulerCoreTests.swift Adds regression coverage for the drag/move interaction to ensure ticks stay hidden until release.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread FreeRulerTests/RulerCoreTests.swift Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@pascalpp
pascalpp merged commit c9f03ed into main Jun 11, 2026
1 check passed
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.

Mouse ticks showing during drag

2 participants