Skip to content

fix: stylus hover triggering canvas pan#1763

Open
alberto-is wants to merge 3 commits into
flxzt:mainfrom
alberto-is:fix-stylus-hover-pan
Open

fix: stylus hover triggering canvas pan#1763
alberto-is wants to merge 3 commits into
flxzt:mainfrom
alberto-is:fix-stylus-hover-pan

Conversation

@alberto-is

Copy link
Copy Markdown
Contributor

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

Comment thread crates/rnote-ui/src/canvaswrapper.rs Outdated
@alberto-is alberto-is force-pushed the fix-stylus-hover-pan branch from 48053b7 to 3634419 Compare May 14, 2026 15:12
@proudmuslim-dev

Copy link
Copy Markdown

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)
OS: NixOS Unstable
Kernel: 7.0.9 (mainline)
App Version: Rnote v0.14.2
Installation Source: Nixpkgs unstable
GTK: 4.22.4
Libadwaita: 1.9.0
WM: Swaywm (v1.12)
Session: Wayland (XDG_SESSION_TYPE=wayland)

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.

Holding stylus secondary button pans canvas when hovering

4 participants