Adds the ability to pin the currently developed photo to the 2nd darkroom window #19963
+633
−60
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 change adds two buttons to the 2nd darkroom window, making this functionality more generally useful:
A "pin" button to keep the 2nd window focused on the currently developed images. Changing images in the darktable main window does not affect the content of the 2nd window. This is useful to use the 2nd window as a reference, e.g., for style matching or color grading.
A "keep on top" button, which keeps the 2nd window on top of the main one. This is especially useful for macOS users, as the OS does not implement this functionality natively.
The two changes are bundled together because on macOS pinning the image without being able to keep it in on top greatly reduces its usefulness. Additionally, the code footprint of (2) is negligible.
The change was proposed and discussed on Pixls, and the community seemed to welcome it.
The implementation discussed on Pixls was taking a full-size snapshot of the image. Following @dterrahe's suggestions, I reimplemented it to use a separate pixelpipe for the 2nd window.
When the image is pinned, the current pipe is duplicated and the view of 2nd window updated to point to insist on the new pipe. When the image is unpinned, the 2nd pipe is destroyed and the main darkroom pipe is restored.
See demo video below:
Screen.Recording.2025-12-21.at.13.56.27.mp4
You will see a lot of examples with composite (overlay) and watermark, as the changes introduced in develop.c to be able to reuse the pipe had broken that functionality. It took me quite a bit to track down the issue and fix it. The problematic bit is documented in the code.
I tested extensively opening and closing the 2nd window, pinning and unpinning repeatedly while the main image is still being rendered, which led me to fix some issues with the 2nd window cleanup code.
I am quite confident that the logic is sound now, but I am not familiar with the pixelpipe code so a close inspection from more expert eyes is very welcome. Everything seems to work as expected, but you never know.