Skip to content

Activate 100% zoom limit again#21031

Merged
TurboGit merged 4 commits into
darktable-org:masterfrom
da-phil:restrict_zooming_to_100_percent_by_default
May 22, 2026
Merged

Activate 100% zoom limit again#21031
TurboGit merged 4 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 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?

Comment thread data/darktableconfig.xml.in Outdated
@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented May 19, 2026

@TurboGit @jenshannoschwalm I pushed a new commit with the DT_SIGNAL_PREFERENCES_CHANGE approach, however it does not seem to work for me, can you help me pointing out the issue?
The new callbacks are never called, no matter how often I change both params.

@da-phil da-phil force-pushed the restrict_zooming_to_100_percent_by_default branch from db791d2 to 1bb2a00 Compare May 19, 2026 12:49
@TurboGit
Copy link
Copy Markdown
Member

Let me have a look...

Comment thread src/views/darkroom.c Outdated
@da-phil da-phil force-pushed the restrict_zooming_to_100_percent_by_default branch from 1bb2a00 to 2106a49 Compare May 19, 2026 22:19
@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented May 19, 2026

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?

After another look and knowing how it works I fully agree and would propose the following steps:

  • if interface related settings are only relevant for one DT module (e.g. lighttable / darkroom) move those settings inside this respective menu (e.g. prefs="lighttable" section="interface" and prefs="darkroom section="interface")
  • consolidate config callbacks a little bit, I think we have way to many callbacks flying around everywhere

@wpferguson
Copy link
Copy Markdown
Member

wpferguson commented May 19, 2026

After another look and knowing how it works I fully agree and would propose the following steps:

if interface related settings are only relevant for one DT module (e.g. lighttable / darkroom) move those settings inside this respective menu (e.g. prefs="lighttable" section="interface" and prefs="darkroom section="interface")
consolidate config callbacks a little bit, I think we have way to many callbacks flying around everywhere

How about we make that a separate PR? PRs that grow in scope tend to not end well.

EDIT: Also, if we are talking about messing with callbacks this should probably be for 5.8 and not something we try and shoehorn into 5.6.

@da-phil
Copy link
Copy Markdown
Contributor Author

da-phil commented May 20, 2026

After another look and knowing how it works I fully agree and would propose the following steps:

if interface related settings are only relevant for one DT module (e.g. lighttable / darkroom) move those settings inside this respective menu (e.g. prefs="lighttable" section="interface" and prefs="darkroom section="interface")
consolidate config callbacks a little bit, I think we have way to many callbacks flying around everywhere

How about we make that a separate PR? PRs that grow in scope tend to not end well.

EDIT: Also, if we are talking about messing with callbacks this should probably be for 5.8 and not something we try and shoehorn into 5.6.

I never said this should be part of this PR, as I agree with you about not blowing up the scope of this PR, it seems @TurboGit is in favour of doing it though: #21031 (comment)

I'm fine either way but would also prefer a separate PR.

@TurboGit
Copy link
Copy Markdown
Member

I never said this should be part of this PR, as I agree with you about not blowing up the scope of this PR, it seems @TurboGit is in favour of doing it though: #21031 (comment)

I'm fine either way but would also prefer a separate PR.

Yes, this change should be part of another PR and probably for 5.8.

@da-phil da-phil force-pushed the restrict_zooming_to_100_percent_by_default branch from e33c961 to 6298077 Compare May 21, 2026 22:02
da-phil added 4 commits May 22, 2026 00:03
* 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 6298077 to af02e7e Compare May 21, 2026 22:03
Copy link
Copy Markdown
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, thanks:

@TurboGit TurboGit merged commit 9402c65 into darktable-org:master May 22, 2026
5 checks passed
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 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.

4 participants