Skip to content

Fix touchpad pan gesture suppressed when editing masks#21490

Open
da-phil wants to merge 1 commit into
darktable-org:masterfrom
da-phil:fix_pan_gesture_when_editing_masks
Open

Fix touchpad pan gesture suppressed when editing masks#21490
da-phil wants to merge 1 commit into
darktable-org:masterfrom
da-phil:fix_pan_gesture_when_editing_masks

Conversation

@da-phil

@da-phil da-phil commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

A two-finger scroll (no CTRL) fell through to zoom whenever a mask overlay was visible, even with the pointer off the mask. gesture_pan now declines the pan only when the scroll would actually be consumed by the mask (pointer over a shape, or creating a size-adjustable shape) via the new dt_masks_scroll_over_mask() predicate. Elsewhere on the canvas, and while drawing a path (which has no scroll-adjustable parameter during creation), the scroll pans the image as expected.

Here is the updated behavior overview:

  ┌─────────────────────────────┬────────────────────┬──────────────────────────┐
  │           Gesture           │ Cursor inside mask │   Cursor outside mask    │
  ├─────────────────────────────┼────────────────────┼──────────────────────────┤
  │ Two-finger scroll (no Ctrl) │ resize mask        │ pan   (was zoom)         │
  ├─────────────────────────────┼────────────────────┼──────────────────────────┤
  │ Ctrl + two-finger scroll    │ opacity            │ zoom  (matches mouse)    │
  ├─────────────────────────────┼────────────────────┼──────────────────────────┤
  │ Pinch                       │ zoom               │ zoom                     │
  └─────────────────────────────┴────────────────────┴──────────────────────────┘

  ┌────────────────────────────────────────┬──────────────────────────────────────────┐
  │                 State                  │       Two-finger scroll (no Ctrl)        │
  ├────────────────────────────────────────┼──────────────────────────────────────────┤
  │ Drawing a path                         │ pan (was zoom)                           │
  ├────────────────────────────────────────┼──────────────────────────────────────────┤
  │ Creating circle/ellipse/gradient/brush │ adjust default size/border (unchanged)   │
  ├────────────────────────────────────────┼──────────────────────────────────────────┤
  │ Pointer over an existing shape         │ resize                                   │
  ├────────────────────────────────────────┼──────────────────────────────────────────┤
  │ Pointer off the mask                   │ pan                                      │
  └────────────────────────────────────────┴──────────────────────────────────────────┘

Disclaimer: this work has been co-created with Claude.

A two-finger scroll (no CTRL) fell through to zoom whenever a mask
overlay was visible, even with the pointer off the mask. gesture_pan
now declines the pan only when the scroll would actually be consumed
by the mask (pointer over a shape, or creating a size-adjustable
shape) via the new dt_masks_scroll_over_mask() predicate. Elsewhere
on the canvas, and while drawing a path (which has no scroll-adjustable
parameter during creation), the scroll pans the image as expected.
@da-phil

da-phil commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

@TurboGit I think this one qualifies for a 5.6.1, given that touchpad gestures were (properly) introduced in that release.

@da-phil da-phil marked this pull request as ready for review July 4, 2026 20:13
@TurboGit TurboGit added this to the 5.6.1 milestone Jul 4, 2026
@TurboGit TurboGit added bugfix pull request fixing a bug priority: medium core features are degraded in a way that is still mostly usable, software stutters scope: codebase making darktable source code easier to manage release notes: pending labels Jul 4, 2026
@ralfbrown

Copy link
Copy Markdown
Collaborator

Does this code correctly result in zooming while holding down the 'a' key even when the pointer is over a shape?

@da-phil

da-phil commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Does this code correctly result in zooming while holding down the 'a' key even when the pointer is over a shape?

It does, with mouse wheel scroll gesture. On the touchpad the pointer is freezing as soon as "a" is pressed and all touchpad gestures ignored. It this how it should behave? I wasn't even aware of this alternative behavior using the "a" key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug priority: medium core features are degraded in a way that is still mostly usable, software stutters release notes: pending scope: codebase making darktable source code easier to manage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants