fix: stylus hover triggering canvas pan#1763
Open
alberto-is wants to merge 3 commits into
Open
Conversation
48053b7 to
3634419
Compare
|
Been using this patch for about a week with no issues (albeit on the latest release rather than the main branch) Device: Wacom Intuos Pro M (2017) |
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 #1468
What changed
Prevent canvas pan gestures from starting on stylus hover (pressure == 0), while keeping mouse/touch behavior unchanged.
Why
On some stylus devices, pressing a pen button while hovering can trigger drag gestures, moving the canvas unexpectedly. This filters out stylus hover events so the assigned shortcut still works without causing unintended panning.
Testing
cargo fmt --check
meson compile ui-cargo-clippy -C _mesonbuild
Manual: verified canvas pan still works with mouse drag
Manual: confirmed pen button no longer triggers unintended pan on stylus hover
Note: clippy reports existing warnings in crates/rnote-ui/src/dialogs/import.rs — not introduced by this change.
Environment / Device
Device: Wacom Intuos S Pad + Pen
OS: Arch Linux x86_64
Kernel: 7.0.3-arch1-2
DE/WM: KDE Plasma 6.6.4 / KWin
Session: Wayland (XDG_SESSION_TYPE=wayland)
Rnote: 0.14.2
GTK: 4.22.4
Libadwaita: 1.9.0