Touchpad: allow simultaneous smartphone-like pinch zoom and pan gestures in culling layouts#20888
Draft
da-phil wants to merge 2 commits intodarktable-org:masterfrom
Draft
Conversation
848124c to
9206e8d
Compare
Pinch-zoom and ctrl+scroll in culling re-runs the full mipmap fetch + color transform on every event, so the gesture stutters even though the underlying image content does not change. Cache the native-resolution color-converted mipmap surface per thumbnail and add a deferred preview path: during a gesture _thumb_draw_image rescales the existing surface via a cairo transform, and the proper surface reload is triggered once the gesture finishes via dt_culling_zoom_end(). Add a smooth-scroll ctrl path so touchpad zoom feels seamless rather than batched into 0.5-unit steps. The bound formulas in _zoom_to_center, _event_motion_notify, dt_culling_pan_move and dt_thumbnail_image_refresh_position now derive from thumb->zoom directly so they stay correct while the surface still shows the gesture-start zoom.
9206e8d to
e597dde
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses request (e) of issue #20750.
This change allows smartphone-like simultaneous gesture based pinch zooming and panning within the lighttable culling layouts when having two pictures next to each other.
The behavior works as implemented for the darkroom in #20812.
Screencast.from.2026-04-27.16-26-01.mp4
I start this as a draft PR, because it also contains caching code for the culling layout, which made this work much easier and smoother. I'll try to factor out this code into a separate PR.
Disclaimer: this work was co-created with Claude.