Touchpad: allow simultaneous smartphone-like pinch zoom and pan gestures in darkroom#20812
Touchpad: allow simultaneous smartphone-like pinch zoom and pan gestures in darkroom#20812da-phil wants to merge 5 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. |
|
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? |
|
Unfortunately no change. I start with pinch to zoom and then pan. Only zoom is recognized: |
|
Thank you for the logs again. I'm not sure why it still doesn't work. I added more logging that will hopefully reveal what's actually reaching Can you please run the latest changes and provide logs for the following scenarios:
Thanks! |
|
Ok, lots of output coming...
|
|
The other way (start with pan and then zoom) is also not recognized, it keeps panning. |
|
Phew, it seems that the macOS quartz GTK backend works completely different than for Windows & Linux, E.g. on my Linux laptop I receive pinch events which simultaneous updates to After feeding the data to copilot for analysis, this is the final verdict, which is also quite obvious from looking at the data:
I don't think I'll continue going down this path for this PR as I do not have access to a MacBook for testing, sorry :/ Maybe a follow-up question: do you know another open-source GTK based software which allows this kind of smartphone-like combined zoom + pan touchpad gestures? |
Inkscape is also a GTK3 application and it shows the exact same behavior: You either pinch or pan on macOS, not simultaneously. |
Hmmm, another indicator that it seems it's not possible with the macOS quartz GTK backend :/ |
b26418c to
3ee6473
Compare
|
@zisoft last question: does the current state of the PR is cause any touchpad behavior regressions on macOS for you? @ All other users and contributors running Windows & Linux: please give this PR a try and provide some feedback if it works for you. |
besides the already discussed simultaneously panning/zooming: No, everything works as expected. |
As far as remember, he said that this feature doesn't even work on master currently. The scope of this PR is just allowing simultaneous pitch and pannig gestures within darkroom. |
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).
3ee6473 to
1d647fb
Compare
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.