Skip to content

Activate 100% zoom limit again#21031

Open
da-phil wants to merge 2 commits into
darktable-org:masterfrom
da-phil:restrict_zooming_to_100_percent_by_default
Open

Activate 100% zoom limit again#21031
da-phil wants to merge 2 commits into
darktable-org:masterfrom
da-phil:restrict_zooming_to_100_percent_by_default

Conversation

@da-phil
Copy link
Copy Markdown
Contributor

@da-phil da-phil commented May 15, 2026

Activate 100% scroll limit again and also make scroll limit configurable through config parameter darkroom/ui/constrain_zoom, which is TRUE by default, keeping the previous
behavior:

  • zooming in is limited to 100%
  • zooming out is limited to screen-fit

This is an effort to satisfy both use-cases discussed in #21027.

Disclaimer: this work was co-created with Claude.

@da-phil da-phil changed the title Activate 100% scroll limit again Activate 100% zoom limit again May 15, 2026
@da-phil da-phil force-pushed the restrict_zooming_to_100_percent_by_default branch from b3f01dc to a47afa2 Compare May 15, 2026 00:10
@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented May 15, 2026

It would be great to receive a review from @dterrahe, as he wrote most of the GTK touchpad / mouse input code and introduced the constrain flag.

I'm not sure if we use the constrain flag in the right way which was intended. My understanding was that it constrains the zoom levels in the following way:

  • limit zoom to "fit to screen" when zooming out
  • limit zoom to 100% when zooming in

Please correct me if this assumption was wrong.

@da-phil da-phil force-pushed the restrict_zooming_to_100_percent_by_default branch 2 times, most recently from 1c57c30 to 06965f7 Compare May 16, 2026 11:34
Comment thread src/develop/develop.c Outdated
@da-phil da-phil marked this pull request as ready for review May 16, 2026 12:34
@TurboGit TurboGit added this to the 5.6 milestone May 16, 2026
@TurboGit TurboGit added bugfix pull request fixing a bug priority: high core features are broken and not usable at all, software crashes scope: UI user interface and interactions default-behavior-change labels May 16, 2026
@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented May 16, 2026

@TurboGit let's wait merging this PR, I wanted to know if there is a simpler solution to re-activating the zoom limit, see message: #21027 (comment)

I'm not very happy with the current approach in this PR, which is a kind of a hack to limit zooming. It does not work well, when you do the following:

  • zoom in to 100%
  • press CTRL and zoom in one more step to >100%
  • try to zoom in again -> you'll then fall back to 100% again

I believe only reverting #21011 will bring back the old behavior.

CC: @masterpiga

@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented May 16, 2026

I pushed a proper fix by revering #21011 and reverting my previous approach of introducing a hard limit and break the soft-steps.
Now it also works properly for pinch-zooming.

The more I deal with this functionality and code, the less I like it. But let's keep this well-known behavior for release 5.6 and keep the discussion in #21027 going ;)
If we would change it, we might also need to update some docs over at https://github.com/darktable-org/dtdocs.

@da-phil da-phil force-pushed the restrict_zooming_to_100_percent_by_default branch 3 times, most recently from d66abf9 to 1061f9c Compare May 18, 2026 07:29
@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

  1. I just checked latest version of this PR and for me it works!
  2. If this is ok for @TurboGit to be merged i would prefer the commits to be squashed so one commit for possibly need to bisect.
  3. I think the darkroom/ui/constrain_zoom misses a restart hint.
  4. We now have (too) many options in misc->interface. Maybe a new tab would be preferable including all thouse mouse behaviour related stuff? "Mouse interface" maybe?

@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented May 18, 2026

  1. If this is ok for @TurboGit to be merged i would prefer the commits to be squashed so one commit for possibly need to bisect.

Works for me, will do.

  1. I think the darkroom/ui/constrain_zoom misses a restart hint.

Ah, I see, I didn't pay attention to this little detail in the data/darktableconfig.xml.in file. Will add it then.

  1. We now have (too) many options in misc->interface. Maybe a new tab would be preferable including all thouse mouse behaviour related stuff? "Mouse interface" maybe?

Also sounds good, but I think this should be scoped out for this PR into a separate one, right?

@TurboGit
Copy link
Copy Markdown
Member

@da-phil : Do not squash the revert though.

@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

Also sounds good, but I think this should be scoped out for this PR into a separate one, right?

yup.

da-phil added 2 commits May 18, 2026 11:30
* make scroll limit configurable through
  config parameter `darkroom/ui/constrain_zoom`,
  which is TRUE by default, keeping the previous
  behavior.

* refactored the soft-step zooming logic in
  order to re-use it for pinch-zoom gestures.
@da-phil da-phil force-pushed the restrict_zooming_to_100_percent_by_default branch from 1061f9c to 62af432 Compare May 18, 2026 09:55
@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented May 18, 2026

@TurboGit is the PR tag "default-behavior-change" even correct, given that we keep the same behavior as in the previous release?

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 default-behavior-change priority: high core features are broken and not usable at all, software crashes scope: UI user interface and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants