Fix stylus pointer jump - #1824
Open
alberto-is wants to merge 2 commits into
Open
Conversation
Sometimes the stylus session can stay active forever and block mouse input on the canvas. A deliberate mouse click now ends the session and is processed normally, restoring mouse input with a single click. Other non-stylus events remain ignored while the stylus session is active.
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.
Fixes #1440
Related to #665 and #534
GTK can deliver mouse motion events to the canvas while a stylus is hovering or drawing. Those events were processed using the current stylus state, which could move the pointer to the mouse position and cause unwanted strokes, erasures, pans, or selections, zoom, etc.
Regarding the related issues: Both issues appear to be caused by the same underlying problem, so this PR should resolve them as well. I believe this is the case because keeping the cursor outside the canvas prevents the issue, and the lines shown in their screenshots appear to originate from the same location, which seems to be the mouse pointer position.
Changes
Prevent mouse coordinates from being processed with the stylus state, which caused unwanted strokes, erasures, pans, and selections.
Recover mouse input when GTK does not report the stylus leaving proximity. Without this recovery, the stylus remains active and a mouse click can move the canvas instead of drawing with the mouse.
The following videos demonstrate the behavior before and after the fix:
rnote-jump.mp4
rnote-fix-jump.mp4