Skip to content

Fix stylus pointer jump - #1824

Open
alberto-is wants to merge 2 commits into
flxzt:mainfrom
alberto-is:fix/stylus-pointer-jump-1440
Open

Fix stylus pointer jump #1824
alberto-is wants to merge 2 commits into
flxzt:mainfrom
alberto-is:fix/stylus-pointer-jump-1440

Conversation

@alberto-is

Copy link
Copy Markdown
Contributor

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.

    • Track whether a stylus input session is active in the canvas pointer controller.
    • Ignore non-stylus pointer events while that session is active.
  • 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.

    • Allow a deliberate mouse click to end a stale stylus session and process the click normally..

The following videos demonstrate the behavior before and after the fix:

  • Before the fix:
rnote-jump.mp4
  • After the fix:
rnote-fix-jump.mp4

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.
@alberto-is alberto-is changed the title Fix/stylus pointer jump 1440 Fix stylus pointer jump Aug 18, 2026
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.

Sometimes pointer jumps from stylus position to last position of mouse pointer

1 participant