Adds the ability to pin the currently developed photo to the 2nd darkroom window#19963
Conversation
In the future you might want to raise an issue in the darktable issue tracker to propose your idea. That way you get the views of a different community and make the devs whose areas you're going to touch aware. They may offer suggestions and/or help that could save you time, frustration, etc. The reason I suggest this is what is because of what is happening with the tone equalizer PR. It started the same way (on pixls) and is currently mired in controversy. Now for the PR. You mention MacOS a lot and your images are from there. Did you test on Windows or Linux? |
98dcbfa to
6d5efb4
Compare
Thanks, that is good advice.
I tested on a virtualized Fedora and it works as intended. See video below: Screen.Recording.2025-12-22.at.10.20.02.mp4The video also shows how you can pin at any point in history, not just at the current edit state. I have no way of testing on Windows unfortunately, the last time that I used windows was when XP came out. |
|
One small addition. The layout of the two buttons in the 2nd window currently is hard coded. I would argue that it would make sense to make this more customizable, but I would prefer to do that in a follow up PR. Also, I would like to attach actions to the two toggle buttons so that they can controlled via keyboard shortcuts. I had started doing that but then I noticed that the "quick shortcut" overlay does not work on the 2nd window, so it probably requires more work. I would also leave that for a follow up, in case. |
a368a8f to
ee95270
Compare
ee95270 to
35003af
Compare
|
@masterpiga : Not tested yet as this needs a conflict resolution. I see on the video that the two new icons are vertically aligned, maybe better to have then vertically aligned to avoid loosing spaces on the border? Or maybe it is already the case if the window is made shorter? |
35003af to
51536ee
Compare
|
@masterpiga : Please, do not merge master into your topic branch. You need to rebase on top of current master and fix the conflicts. TIA. |
51536ee to
717d952
Compare
|
Done, @TurboGit. I stacked the buttons vertically as you suggested. I considered making the orientation switch based on the size of the window, but moving controls around is not too great from a UX point of view, so I would rather stick to either vertical or horizontal layout. |
54fe76d to
c0873a9
Compare
|
Pushed a new snapshot, I had accidentally reverted the additions to |
c0873a9 to
fa0822c
Compare
TurboGit
left a comment
There was a problem hiding this comment.
Tested today. I have two requests:
- The "stays on top" does not work on GNU/Linux
- I'd like the two buttons to hide themself after some time and be drawn again when the mouse is close. Something similar is done on the histogram.
fa0822c to
83dc228
Compare
|
Thanks for trying it @TurboGit. The buttons now show when the pointer enters the 2nd window, as you asked. As for keep on top not working on Linux, I cannot reproduce it. Here is it running on a virtualized fedora, where it WAI: Screen.Recording.2026-02-22.at.15.13.58.mp4 |
Maybe a Wayland issue. Is the VM on Wayland or X11? |
|
I believe it's X11: $ echo $XDG_SESSION_TYPE
x11Edit: Yes, I switched to Wayland and it does not work. Let me try to fix it. |
04a0674 to
61dc1c2
Compare
61dc1c2 to
ce93d01
Compare
|
So, @TurboGit. IIUC, the best way to fix this would be to mark the 2nd window as
Note that setting WDYT? |
|
I agree with that. Always on top and then if this is not wanted the user can indeed disable the second window. Seems to cover almost all cases to me. So we keep a single button on the second window to pin the image. |
0404f77 to
04f36d1
Compare
|
Done, @TurboGit. This is on Wayland: Screen.Recording.2026-02-23.at.07.36.41.mp4Tested also on macOS and X11.
|
04f36d1 to
d8173cb
Compare
- Pin/unpin the image currently displayed in the main view to the 2nd window. It is possible to pin at image at any point of the history. - Keep the 2nd window on top (especially useful for macOS, whose WM does not have this functionality). It uses 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.
so that it always stays on top, and drop the dedicated "keep on top" button. - Implement focus following so that tooltips on the 2nd window show also if the window is not explicitly focused.
d8173cb to
b299a96
Compare
|
Yay, thanks @TurboGit, I hope it will turn out to be a useful feature. |
…n the second darkroom window Following the merge of darktable-org/darktable#19963
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.