Skip to content

Adds the ability to pin the currently developed photo to the 2nd darkroom window#19963

Merged
TurboGit merged 3 commits intodarktable-org:masterfrom
masterpiga:pin-photo-in-2nd-window
Feb 23, 2026
Merged

Adds the ability to pin the currently developed photo to the 2nd darkroom window#19963
TurboGit merged 3 commits intodarktable-org:masterfrom
masterpiga:pin-photo-in-2nd-window

Conversation

@masterpiga
Copy link
Copy Markdown
Contributor

This change adds two buttons to the 2nd darkroom window, making this functionality more generally useful:

  1. 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.

  2. 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.

@TurboGit TurboGit added this to the 5.6 milestone Dec 21, 2025
@wpferguson
Copy link
Copy Markdown
Member

wpferguson commented Dec 21, 2025

The change was proposed and discussed on Pixls, and the community seemed to welcome it.

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?

@ralfbrown ralfbrown added feature: new new features to add scope: UI user interface and interactions labels Dec 21, 2025
@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch from 98dcbfa to 6d5efb4 Compare December 22, 2025 08:12
@masterpiga
Copy link
Copy Markdown
Contributor Author

masterpiga commented Dec 22, 2025

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.

Thanks, that is good advice.

Now for the PR. You mention MacOS a lot and your images are from there. Did you test on Windows or Linux?

I tested on a virtualized Fedora and it works as intended. See video below:

Screen.Recording.2025-12-22.at.10.20.02.mp4

The 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.

@masterpiga
Copy link
Copy Markdown
Contributor Author

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.

@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch 2 times, most recently from a368a8f to ee95270 Compare January 10, 2026 14:35
@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch from ee95270 to 35003af Compare January 21, 2026 13:58
@TurboGit TurboGit added documentation: pending a documentation work is required release notes: pending labels Feb 7, 2026
@TurboGit
Copy link
Copy Markdown
Member

TurboGit commented Feb 7, 2026

@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?

@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch from 35003af to 51536ee Compare February 13, 2026 13:57
@TurboGit
Copy link
Copy Markdown
Member

@masterpiga : Please, do not merge master into your topic branch. You need to rebase on top of current master and fix the conflicts. TIA.

@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch from 51536ee to 717d952 Compare February 13, 2026 16:56
@masterpiga
Copy link
Copy Markdown
Contributor Author

masterpiga commented Feb 13, 2026

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.

@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch 4 times, most recently from 54fe76d to c0873a9 Compare February 14, 2026 12:31
@masterpiga
Copy link
Copy Markdown
Contributor Author

Pushed a new snapshot, I had accidentally reverted the additions to darktable.css.

@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch from c0873a9 to fa0822c Compare February 15, 2026 18:53
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.

Tested today. I have two requests:

  1. The "stays on top" does not work on GNU/Linux
  2. 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.

@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch from fa0822c to 83dc228 Compare February 22, 2026 13:19
@masterpiga
Copy link
Copy Markdown
Contributor Author

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

@masterpiga masterpiga requested a review from TurboGit February 22, 2026 14:23
@TurboGit
Copy link
Copy Markdown
Member

As for keep on top not working on Linux, I cannot reproduce it.

Here is it running on a virtualized fedora, where it WAI:

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?

@masterpiga
Copy link
Copy Markdown
Contributor Author

masterpiga commented Feb 22, 2026

I believe it's X11:

$ echo $XDG_SESSION_TYPE 
x11

Edit: Yes, I switched to Wayland and it does not work. Let me try to fix it.

@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch from 04a0674 to 61dc1c2 Compare February 22, 2026 18:19
@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch from 61dc1c2 to ce93d01 Compare February 22, 2026 18:27
@masterpiga
Copy link
Copy Markdown
Contributor Author

masterpiga commented Feb 22, 2026

So, @TurboGit.

IIUC, the best way to fix this would be to mark the 2nd window as transient_for the main window. This would make the 2nd window be always on top of the main window, and would work also on Wayland (tested). IMHO, this would be the right approach:

  1. We can get rid of the "keep on top" button, because the 2nd window is always on top
  2. Since it is a reference window, it kind of makes sense that it stays on top
  3. If the user doesn't want it on top, they can just disable the 2nd window and re-enable it when they want it

Note that setting transient_for is necessary for the tooltips to show on Wayland. If we do not care about the tooltips, we can also use transient_for to toggle the on-top behavior.

WDYT?

@TurboGit
Copy link
Copy Markdown
Member

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.

@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch 3 times, most recently from 0404f77 to 04f36d1 Compare February 23, 2026 06:40
@masterpiga
Copy link
Copy Markdown
Contributor Author

Done, @TurboGit.

This is on Wayland:

Screen.Recording.2026-02-23.at.07.36.41.mp4

Tested also on macOS and X11.

  • 2nd window stays always on top via transient_for
  • Focus follows the mouse to enable tooltip display with no need to click the 2nd window
  • Pin button only shows when 2nd window focused/hovered

@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch from 04f36d1 to d8173cb Compare February 23, 2026 13:03
- 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.
@masterpiga masterpiga force-pushed the pin-photo-in-2nd-window branch from d8173cb to b299a96 Compare February 23, 2026 13: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 a952452 into darktable-org:master Feb 23, 2026
9 of 10 checks passed
@masterpiga
Copy link
Copy Markdown
Contributor Author

Yay, thanks @TurboGit, I hope it will turn out to be a useful feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation: pending a documentation work is required feature: new new features to add scope: UI user interface and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants