Fix click debouncing suppressing mouse up events#1084
Open
sunghyun-k wants to merge 1 commit intolinearmouse:mainfrom
Open
Fix click debouncing suppressing mouse up events#1084sunghyun-k wants to merge 1 commit intolinearmouse:mainfrom
sunghyun-k wants to merge 1 commit intolinearmouse:mainfrom
Conversation
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]>
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
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:
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):
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):
Test plan