Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix click debouncing suppressing mouse up events#1084

Open
sunghyun-k wants to merge 1 commit intolinearmouse:mainfrom
sunghyun-k:issue-912
Open

Fix click debouncing suppressing mouse up events#1084
sunghyun-k wants to merge 1 commit intolinearmouse:mainfrom
sunghyun-k:issue-912

Conversation

@sunghyun-k
Copy link

@sunghyun-k sunghyun-k commented Feb 26, 2026

Summary

  • Fix mouse up events being suppressed when the preceding mouse down was debounced, causing drag operations to not release properly

Fixes #912

Problem

When click debouncing is enabled on a mouse with double-click issues, drag operations (window resizing, file drag & drop) fail to release properly:

  • Window resizing: After finishing a resize and releasing the mouse button, clicking elsewhere causes the window to resize to that position
  • File drag & drop: Files don't drop at the intended destination — they remain "held" and drop wherever the user clicks next

Reproduction video

Reproduction.mov

Root cause

When a mouse bounces during a drag, the debouncing logic ignores the bounced mouse down (correct), but also suppresses the subsequent mouse up (incorrect). This means the OS never receives the release event, so it thinks the button is still held.

Event flow (before fix):

1. Mouse Down (drag start)  → passes through    → OS: button pressed
2. Mouse Up   (bounce)      → passes through    → OS: button released (premature)
3. Mouse Down (bounce)      → debounced ✓       → OS: no event
4. Mouse Up   (real release) → suppressed ✗     → OS: no event (still thinks released from #2)

The state mismatch between steps 2-4 causes the application to mishandle subsequent interactions.

Fix

Remove the logic that suppresses mouse up events when the preceding mouse down was debounced. A mouse up without a matching mouse down is harmless to the OS, but suppressing a mouse up can leave the system in an inconsistent state.

Event flow (after fix):

1. Mouse Down (drag start)  → passes through    → OS: button pressed
2. Mouse Up   (bounce)      → passes through    → OS: button released
3. Mouse Down (bounce)      → debounced ✓       → OS: no event
4. Mouse Up   (real release) → passes through ✓ → OS: harmless no-op

Test plan

  • Manual test: Enable click debouncing → drag window to resize → verify release works correctly
  • Manual test: Enable click debouncing → drag & drop file → verify drop at intended destination

When a mouse down event was debounced, the subsequent mouse up was also
suppressed. This caused drag operations to not release properly - the OS
never received the mouse up event, leading to issues like windows resizing
to unintended positions or files dropping at wrong locations.

Fixes linearmouse#912

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.

About "info ClickDebouncing Mouse up ignored because last mouse down ignored"

1 participant