Touchpad: allow seamless and smartphone-like pinch zoom and pan gestures#20812
Touchpad: allow seamless and smartphone-like pinch zoom and pan gestures#20812da-phil wants to merge 4 commits intodarktable-org:masterfrom
Conversation
|
Maybe that was meant as a reply to my comment in the other PR, with the additional input touchpad logging output: |
|
Works fine on macOS: pan_zoom.mp4But current master is already working the same, so no difference :)
Nothing else in the log |
Cool! As stated above, the additional diagnosis logging output was provided in the other PR which is supposed to generally address issue with touchpad gestures. Does seamless / combined zooming and panning work as well for you? Like a combined zooming & panning gesture, which also works on smartphones? |
|
I can either zoom or pan with two fingers. Starting a zoom and then pan in the same gesture does not work. But as I already wrote above: This also works on current master without this PR. |
Yes, the same for me on Ubuntu 24.04 when running master, however this PR should allow seamless / combined panning & zooming. |
|
@zisoft I pushed two commits which added some logging statements to diagnose why it is not working on macOS, and even a potential fix. This is how it looks for me when zooming in: and for zooming out: |
|
zoom in: zoom out: combined zoom and pan still does not work. |
The macOS built-in trackpad reports as GDK_SOURCE_MOUSE (not GDK_SOURCE_TOUCHPAD). The _scrolled routing condition required either GDK_SOURCE_TOUCHPAD or a device previously seen in a pinch event (_touchpad). On macOS, neither condition held before a pinch had been seen, so two-finger scroll events fell through to dt_view_manager_scrolled (image navigation) instead of gesture_pan (panning). A #ifdef GDK_WINDOWING_QUARTZ branch now routes all non-ctrl smooth scrolls to gesture_pan on macOS. Net result: On macOS, zoom via pinch works (was already working), and pan via two-finger swipe now works via gesture_pan. Combined pinch+pan simultaneously is not possible at the GDK level on macOS — NSEventTypeMagnify does not deliver the translational component; it must be done as sequential operations (zoom then pan).
|
Thanks for providing the log msgs, this was helpful. Can you try again with the latest changes please and provide logs if it still doesn't work? |
This addresses points (d) of issue #20750.
With this change gesture based pinch zooming and panning is seamless and keeps pinch fully continuous for a smartphone-like feeling, including at high zoom levels.
Screencast.from.2026-04-14.11-47-04.mp4
CC @zisoft @MStraeten: I would appreciate feedback on how this feels on MacOS.
Disclaimer: co-created with copilot.