Skip to content

Touchpad: make gestures optional and allow >100% zooming#20810

Open
da-phil wants to merge 2 commits intodarktable-org:masterfrom
da-phil:touchpad_input_updates
Open

Touchpad: make gestures optional and allow >100% zooming#20810
da-phil wants to merge 2 commits intodarktable-org:masterfrom
da-phil:touchpad_input_updates

Conversation

@da-phil
Copy link
Copy Markdown
Contributor

@da-phil da-phil commented Apr 13, 2026

This addresses points (a), (b) and (c) of issue #20750.

Changes:

  • (a) New option darkroom/ui/touchpad_gestures allows to disable touchpad based pinch zooming, it is enabled by default
  • (b) Touchpad pinch zooming now is on par with old CTRL + scroll zooming by allowing to zoom beyond 100%
  • (c) Previous CTRL + scroll zooming is now re-enabled for touchpads next to the gesture based pinch zooming for a happy coexistence

I'd like to know what folks think about whether we even need (a), as everybody unconditionally like to have touchpad pinch gestures enabled, even on older laptops with bad touchpads (far from Apple-grade quality). I do not have a strong opinion on it, but thought it could be usable.

Also: do you think there is a problem if we allow the previous behavior of CTRL + scroll zooming in addition to pinch gesture based zooming as enabled in (c)?
I tried it out for a while and I like it, as I'm still not used to pinch zooming in darktable and try CTRL + scroll zooming ever so often and sometimes I'm too lazy to do finger gymnastics and prefer simple CTRL + scroll zooming over pinch zooming.

Disclaimer: co-created with copilot.

@da-phil da-phil changed the title Make touchpad gestures optional and allow >100% zooming Touchpad: make gestures optional and allow >100% zooming Apr 14, 2026
@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

Just mentioning this, on my thinkpad the darkroom zoom using the touchpad is again broken.

@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented Apr 14, 2026

Just mentioning this, on my thinkpad the darkroom zoom using the touchpad is again broken.

With this change, or with current master?
And what did you mean with "broken", what changed?

And with this change, if you set darkroom/ui/touchpad_gestures=false, is it still broken?

@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

With master. Broken: no zooming.

@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented Apr 14, 2026

With master. Broken: no zooming.

Can you please give this branch a shot and run darktable with input debug outputs (-d input)?
I added some logging statements to make root-causing the issue easier ;)

Ideally, you should see an output similar to this:

    13.4990 [touchpad] gesture event type=42 source='Wayland Pointer' source_type=0
    13.4990 [touchpad] pinch x=1322.21 y=911.72 phase=0 scale=1.000000 state=0x0
    13.4990 [darkroom pinch] begin x=1322.21 y=911.72 scale=1.000000 state=0x0 last=1.000000
    13.4990 [touchpad] gesture event type=42 source='Wayland Pointer' source_type=0
    13.4990 [touchpad] pinch x=1322.21 y=911.72 phase=1 scale=1.007812 state=0x0
    13.4990 [darkroom pinch] below threshold ratio=1.007812 scale=1.007812 last=1.000000
    13.5160 [touchpad] gesture event type=42 source='Wayland Pointer' source_type=0
    13.5160 [touchpad] pinch x=1322.21 y=911.72 phase=1 scale=1.011719 state=0x0
    13.5161 [darkroom pinch] below threshold ratio=1.011719 scale=1.011719 last=1.000000
    13.5287 [touchpad] gesture event type=42 source='Wayland Pointer' source_type=0
    13.5288 [touchpad] pinch x=1322.21 y=911.72 phase=1 scale=1.015625 state=0x0
    13.5288 [darkroom pinch] below threshold ratio=1.015625 scale=1.015625 last=1.000000
    13.5288 [touchpad] gesture event type=42 source='Wayland Pointer' source_type=0
    13.5288 [touchpad] pinch x=1322.21 y=911.72 phase=1 scale=1.019531 state=0x0
    13.5288 [darkroom pinch] below threshold ratio=1.019531 scale=1.019531 last=1.000000
    13.5344 [touchpad] gesture event type=42 source='Wayland Pointer' source_type=0
    13.5345 [touchpad] pinch x=1322.21 y=911.72 phase=1 scale=1.023438 state=0x0
    13.5345 [darkroom pinch] below threshold ratio=1.023438 scale=1.023438 last=1.000000
    13.5418 [touchpad] gesture event type=42 source='Wayland Pointer' source_type=0
    13.5418 [touchpad] pinch x=1322.21 y=911.72 phase=1 scale=1.023438 state=0x0
    13.5418 [darkroom pinch] below threshold ratio=1.023438 scale=1.023438 last=1.000000
    13.5587 [touchpad] gesture event type=42 source='Wayland Pointer' source_type=0
    13.5587 [touchpad] pinch x=1322.21 y=911.72 phase=1 scale=1.031250 state=0x0
    13.5587 [darkroom pinch] below threshold ratio=1.031250 scale=1.031250 last=1.000000
    13.5588 [touchpad] gesture event type=42 source='Wayland Pointer' source_type=0
    13.5588 [touchpad] pinch x=1322.21 y=911.72 phase=1 scale=1.035156 state=0x0
    13.5588 [darkroom pinch] below threshold ratio=1.035156 scale=1.035156 last=1.000000
    13.5633 [touchpad] gesture event type=42 source='Wayland Pointer' source_type=0
    13.5633 [touchpad] pinch x=1322.21 y=911.72 phase=1 scale=1.035156 state=0x0

@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented Apr 25, 2026

@jenshannoschwalm could you please give this PR a shot and share the -d input logs for me to understand why the current implementation does not work for you?

@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

could you please give this PR a shot and

Needs some fixes to be done when rebasing to master ...

@da-phil da-phil force-pushed the touchpad_input_updates branch from 6c9eb40 to d01526b Compare April 25, 2026 11:47
@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented Apr 25, 2026

could you please give this PR a shot and

Needs some fixes to be done when rebasing to master ...

My bad, I didn't notice. You should be good to go now.

@jenshannoschwalm
Copy link
Copy Markdown
Collaborator


[dt starting] as : darktable -d input
     0,9111 [input device] Input devices found:

     0,9111 Wayland Keyboard (no cursor), source: GDK_SOURCE_KEYBOARD, mode: GDK_MODE_SCREEN, 0 axes, 0 keys
     0,9111 Wayland Pointer (with cursor), source: GDK_SOURCE_MOUSE, mode: GDK_MODE_SCREEN, 2 axes, 0 keys
     0,9111   GDK_AXIS_X
     0,9111   GDK_AXIS_Y
     2,1496 [_midi_open_devices] PortMidi initialized
     2,1496 [_midi_open_devices] found midi device 'Midi Through Port-0' via 'ALSA'
     2,1496 [_midi_open_devices] found midi device 'Midi Through Port-0' via 'ALSA'
     2,2109 [_gamepad_open_devices] SDL initialized
    11,7659 [touchpad] pan x=568,20 y=410,93 dx=0,000 dy=-44,688 source='Wayland Finger Scrolling'
    11,7951 [touchpad] pan x=568,20 y=410,93 dx=0,000 dy=-55,215 source='Wayland Finger Scrolling'
    11,7951 [touchpad] pan x=568,20 y=410,93 dx=0,000 dy=-36,816 source='Wayland Finger Scrolling'
    11,7952 [touchpad] pan x=568,20 y=410,93 dx=0,000 dy=-43,379 source='Wayland Finger Scrolling'
    11,7998 [touchpad] pan x=568,20 y=410,93 dx=0,000 dy=-36,816 source='Wayland Finger Scrolling'
    11,8350 [touchpad] pan x=568,20 y=410,93 dx=0,000 dy=-31,543 source='Wayland Finger Scrolling'
    11,8351 [touchpad] pan x=568,20 y=410,93 dx=0,000 dy=-31,543 source='Wayland Finger Scrolling'
    11,8351 [touchpad] pan x=568,20 y=410,93 dx=0,000 dy=-32,871 source='Wayland Finger Scrolling'
    11,8351 [touchpad] pan x=568,20 y=410,93 dx=0,000 dy=-46,016 source='Wayland Finger Scrolling'
    11,8367 [touchpad] pan x=568,20 y=410,93 dx=0,000 dy=-51,270 source='Wayland Finger Scrolling'
    11,8681 [touchpad] pan x=568,20 y=410,93 dx=0,000 dy=-40,742 source='Wayland Finger Scrolling'
    11,8682 [touchpad] pan x=568,20 y=410,93 dx=0,000 dy=-34,180 source='Wayland Finger Scrolling'

That's what i see when a) starting dt b) open an image in darkroom and try to zoom via the touchpad with two fingers. For very long this lead to zooming in, it was broken and at least for some work again after pascal did the partly revert ...

@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented Apr 26, 2026

That's what i see when a) starting dt b) open an image in darkroom and try to zoom via the touchpad with two fingers. For very long this lead to zooming in, it was broken and at least for some work again after pascal did the partly revert ...

Just to be very clear: with "try to zoom via the touchpad with two fingers" you mean pinch zoom (moving two fingers away from each other or towards each other), not scroll zoom (moving two fingers in parallel while pressing CTRL)?

@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

Just to be very clear: with "try to zoom via the touchpad with two fingers" you mean pinch zoom (moving two fingers away from each other or towards each other), not scroll zoom (moving two fingers in parallel while pressing CTRL)?

Aaah, got it now. It feels very strage right now but i guess my "finger memory" will soon adopt.

So - yes - it seems to work exactly as intended :-) Thanks !

@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented Apr 26, 2026

Just to be very clear: with "try to zoom via the touchpad with two fingers" you mean pinch zoom (moving two fingers away from each other or towards each other), not scroll zoom (moving two fingers in parallel while pressing CTRL)?

Aaah, got it now. It feels very strage right now but i guess my "finger memory" will soon adopt.

So - yes - it seems to work exactly as intended :-) Thanks !

So both (pinch zoom AND scroll zoom) work for you? And it works well?
Because on current master, scroll zoom stopped working and I was not able to zoom beyond 100%, which was annoying if you occasionally need to pixel-peep 🧐

da-phil added 2 commits April 26, 2026 21:03
This addresses darktable-org#20750.

* New option darkroom/ui/touchpad_gestures allows to disable
  touchpad based pinch zooming, it is enabled by default
* Touchpad pinch zooming now is on par with old CTRL + scroll
  zooming by allowing to zoom beyond 100%
* Previous CTRL + scroll zooming is now re-enabled for touchpads
  next to the gesture based pinch zooming for a happy coexistance
@da-phil da-phil force-pushed the touchpad_input_updates branch from d01526b to 3cc8309 Compare April 26, 2026 19:04
@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

  1. I can both "pinch zoom" and "control zoom" up to 1600. (Although that "feels" quite strange to me. If using a mouse, zooming-in via the scrollwheel is restricted to 100%, i can combine with pressing control and zoom to 1600)
  2. What i (personally) don't like and what seemed "broken" to me is: Until a few months ago i could zoom in/out by two-fingers on touchpad moving up/down. Now that does the same as when i combine left-mouse-button pressed and move with one finger around - move selected area around.

@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented Apr 27, 2026

Re 1) I see, do you agree that behavior between mouse and touchpad based zooming should be consistent and go up until 1600% without additionally pressing CTRL? I can also remove this "100% barrier" for the mouse input if we agree that there is no advantage of this barrier.

Re 2) I think that is a design choice, given that two fingers can now command two sort of gestures: pinch zoom and panning motions, AFAIK this is the default behavior for UI systems which allow such gestures, as otherwise there will be no way to distinguish between a scroll zoom (moving two fingers up and down in parallel) and a panning motion (moving two fingers around in any direction in parallel).
Now, a scroll-zoom requires additionally pressing CTRL, which IMHO is reasonable, given that pinch zooming can still achieve a two finger zoom action without the need of any keyboard key pressed in addition. If people are not happy with that, I added to this PR the option to disable gesture based inputs entirely: setting darkroom/ui/touchpad_gestures=false with darktablerc. However, I did not thoroughly test this setting as it is not something I'd use. But if enough people think this wold be actually useful, I'd spend more time to make this work and restore the "zoom in/out by two-fingers on touchpad moving up/down" behavior, you described above.

@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

I see, do you agree that behavior between mouse and touchpad based zooming should be consistent and go up until 1600% without additionally pressing CTRL?

In fact, no :-) But that's mainly my personal choice. (Although i vaguely remember we had discussions about this. And we chose to make "simple-zooming" to be restricted to 100% as that makes life easier and pixelpeeping is not something we do often. @TurboGit , any opinion on this? )

About (2) i don't care that much as i use the notebook/touchpad only when main system is not available ... If people mainly on systems without a mouse but with touchpad feel more happy with the "new way" i am fine too and my fingers will adopt.

@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented Apr 28, 2026

I see, do you agree that behavior between mouse and touchpad based zooming should be consistent and go up until 1600% without additionally pressing CTRL?

In fact, no :-) But that's mainly my personal choice. (Although i vaguely remember we had discussions about this. And we chose to make "simple-zooming" to be restricted to 100% as that makes life easier and pixelpeeping is not something we do often. @TurboGit , any opinion on this? )

I'm wondering about the emerging usability issues when zooming beyond 100% is possible.
Is it easily possible to overshoot and ending up in a way too high zooming level? At least that has never been an issue for me.
E.g. I have a shortcut for zooming to 100% (good old shortcuts from geeqie 😄), so once I'm manually zooming, I do not want to be restricted by only zooming to 100%, as this can be achieved with one keystroke already.

About (2) i don't care that much as i use the notebook/touchpad only when main system is not available ... If people mainly on systems without a mouse but with touchpad feel more happy with the "new way" i am fine too and my fingers will adopt.

So you think that we should not have a settings option to disable gestures generally because it might not be used by many people and is essentially just yet another settings option we need to maintain (would be my stance, but I respect if other people want to disable gestures).

@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

Is it easily possible to overshoot and ending up in a way too high zooming level?

Yes for me and i don't think it's nice :-) Zooming-in centered at a givin location is something i use quite often - and that used to be very easy with one hand - but pixelpeeping? Only when debugging or developing rawspace code :-)

So you think that we should not have a settings option to disable gestures generally

I honestly don't know. Even more preferences - hopefully no. Not knowing because i would always try to avoid any special "two finger tricks". But that's just me.

@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented Apr 29, 2026

Is it easily possible to overshoot and ending up in a way too high zooming level?

Yes for me and i don't think it's nice :-) Zooming-in centered at a givin location is something i use quite often - and that used to be very easy with one hand - but pixelpeeping? Only when debugging or developing rawspace code :-)

Hmmm, I'm thinking about a convenient way how we can limit zoom gestures to 100% while still allowing to zoom in more without any additional keyboard interaction. I think technically it is possible, but might overcomplicate the implementation. Something like: zooming is always limited to 100% during one zoom gesture (either scroll or pinch gesture), if another zoom gesture is done - while zoomed in to 100% already - zooming until 1600% is possible.
Or implement a dead-zone during a continuous zoom gesture, say from 100%-120% to prevent overshooting and still allow zooming further in if you go beyond that dead-zone?

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.

2 participants