Skip to content

lighttable: act on the hovered image after entering culling - #22289

Closed
kofa73 wants to merge 2 commits into
darktable-org:masterfrom
kofa73:fix-21982-culling-hover-act-on
Closed

kofa73 wants to merge 2 commits into
darktable-org:masterfrom
kofa73:fix-21982-culling-hover-act-on

Conversation

@kofa73

@kofa73 kofa73 commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #21982

Problem

With "prioritize the hovered image over the selected images" on, entering
culling or full preview with a keyboard shortcut left ratings, rejects and
other actions applying to every selected image, not to the image under the
pointer. Clicking an image did not help. The problem went away only after a
trip to darkroom and back.

Fix

act_on uses the thumbtable's mouse_inside flag to choose between the
selection and the hovered image (src/common/act_on.c:247). When a shortcut
hides the thumbtable, the shortcut holds a pointer grab. The leave event
therefore arrives as a grab crossing, which the thumbtable's leave handler
ignores on purpose (#21729, #21745). As a result, mouse_inside stayed TRUE
while the thumbtable was hidden.

_lighttable_check_layout() and _preview_enter() now clear mouse_inside
when they hide the thumbtable. Darkroom already does the same on entry
(src/views/darkroom.c:4064). This explains why a trip to darkroom fixed
the problem.

Code by Claude Code, review by Codex and Gemini

@kofa73

kofa73 commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@TurboGit @zisoft:

UNTESTED, please check before merging

@zisoft

zisoft commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Does not work for me.

In the video I select 5 images and apply rating/reject to the hovered image. It is always applied to all 5 images.

screen.mp4

@kofa73

kofa73 commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator Author

I select 5 images and apply rating/reject to the hovered image. It is always applied to all 5 images.

Your video shows file manager mode. I think the behaviour you describe matches the documented behaviour:

hover
When the pointer hovers over any image’s thumbnail, it is highlighted and its image implicitly selected for keyboard shortcuts. If that thumbnail is part of a currently-selected set, certain shortcuts will be applied to all images of the set (for example, a numeric digit star rating).
(https://docs.darktable.org/usermanual/development/en/lighttable/lighttable-modes/filemanager/)

The PR changes only the culling and full-preview modes.

@kofa73

kofa73 commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

You are right in that another piece contradicts that in the documentation:

prioritize the hovered image over the selected images
Controls which images are affected by an action (e.g. using the keyboard to set the number of stars). If this option is enabled, only the image hovered over is affected by the action.
(https://docs.darktable.org/usermanual/development/en/preferences-settings/lighttable/#general)

The code contains a table - according to that table (used when "prioritize the hovered image over the selected images" is enabled), if hovering over an image that's part of the selection, the whole selection is affected.

/** Here's how it works
*
* mouse over| x | x | x | | |
* mouse inside table| x | x | | | |
* mouse inside selection| x | | | | |
* active images| ? | ? | x | | x |
* | | | | | |
* | S | O | O | S | A |
* S = selection ; O = mouseover ; A = active images
* the mouse can be outside thumbtable in case of filmstrip + mouse in center widget
*
* if only_visible is FALSE, then it will add also not visible
* images because of grouping force define if we try to use cache
* or not if ordered is TRUE, we return the list in the gui
* order. Otherwise the order is undefined (but quicker)

However, that's not what the manual (above), the tooltip:
image

and the welcome screen promise:
image

I would treat that as a separate issue.

@Macchiato17 , is the culling issue fixed for you?

@zisoft

zisoft commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Your video shows file manager mode. I think the behaviour you describe matches the documented behaviour:

The PR changes only the culling and full-preview modes.

Ok tried again and cannot reproduce with current master:

culling.mp4

Am I still on the wrong track?

@kofa73

kofa73 commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator Author

Please bear with me.

  • The original bug report was about culling mode with "prioritize the hovered image..." turned on.
  • You posted a video using this branch, but in file manager mode, which seems unrelated.
  • Your second video is in culling mode, on master (so without the changes from this PR), and, if I understand correctly, you don't see ("cannot reproduce with current master") the behaviour described by the original issue report?

Do you have "prioritize the hovered image..." enabled?

I can only test this myself after working hours.

@hats-np

hats-np commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

I am struggling to replicate as well, but there is an additional detail.

The setting is: lighttable -> prioritize the hovered image over the selected images

Shouldn't this behavior also happen in the file manager layout, since the setting does not specify the layout? Currently the hovered image is ignored and it's always applied to the selected images.

@hats-np

hats-np commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Furthermore, how do you select multiple images in culling mode? You can select them in the bottom grid (which updates the images displayed in the light table) but not in the light table?

@zisoft

zisoft commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Please bear with me.

me too :)

  • The original bug report was about culling mode with "prioritize the hovered image..." turned on.
  • You posted a video using this branch, but in file manager mode, which seems unrelated.

yes, my fault.

  • Your second video is in culling mode, on master (so without the changes from this PR), and, if I understand correctly, you don't see ("cannot reproduce with current master") the behaviour described by the original issue report?

Exactly. I first wanted to reproduce the issue before I see the difference with your PR, but I cannot replicate.

Do you have "prioritize the hovered image..." enabled?

Bildschirmfoto 2026-09-16 um 15 45 15

@zisoft

zisoft commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Furthermore, how do you select multiple images in culling mode? You can select them in the bottom grid (which updates the images displayed in the light table) but not in the light table?

Select the images in filemanager mode, then enter culling mode.

@hats-np

hats-np commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Select the images in filemanager mode, then enter culling mode.

I meant the other select, not the select to begin culling that group of images. Inside the culling view, you can select an image, but not multiple.

@wpferguson

Copy link
Copy Markdown
Member

I think part of the confusion here is that there are really only 2 lighttable modes, filemanager and zoomable. Culling is an "overlay" or "filter" on top of the current lighttable mode which is still active underneath so selections, filters, sorting affect what culling mode is working with and how actions apply.

@hats-np

hats-np commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

I think part of the confusion here is that there are really only 2 lighttable modes, filemanager and zoomable. Culling is an "overlay" or "filter" on top of the current lighttable mode which is still active underneath so selections, filters, sorting affect what culling mode is working with and how actions apply.

Then I believe the lighttable -> prioritize the hovered image over the selected images is broken in 5.6.1 as well. Should an issue be opened, or is it better to reuse the original issue that lead to this PR?

@kofa73

kofa73 commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator Author

I believe the lighttable -> prioritize the hovered image over the selected images is broken in 5.6.1 as well.

What exactly is broken? The lighttable video in #22289 (comment) demonstrates what the code says: if hovering over an image that's part of a selection, all of the images in the selection are affected, and that matches the docs (#22289 (comment)) as well. Or are you talking about culling mode in 5.6.1?

If the behaviour is different than what was reported as a gtk4 regression, then please file a new bug.

@hats-np

hats-np commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Nevermind me, trouble comprehending :) I thought that with the setting, regardless of selection it would only apply to the hovered image, it's not very clear from the setting description in the manual.

With "prioritize the hovered image" on, ratings and rejects in culling
and full preview hit the whole selection instead of the hovered image.

- act_on reads the thumbtable's mouse_inside to decide between selection
  and hovered image
- entering culling/preview via a shortcut hides the thumbtable during a
  pointer grab, so its leave handler never clears mouse_inside
- reset it when hiding the thumbtable, as darkroom already does

Fixes darktable-org#21982
@kofa73
kofa73 force-pushed the fix-21982-culling-hover-act-on branch from 87bcd25 to cf3ec2f Compare September 19, 2026 06:14
@kofa73

kofa73 commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator Author

If no objections, I'll take this out of draft state.

@TurboGit

Copy link
Copy Markdown
Member

Ok, tested and as for others I can't reproduce, let's give a precise step-by-step way to reproduce to be sure we are on the same track, on my side:

  • Yes, I do have prioritize the hovered image over the selected images, set (the default)
  • I start Darktable, on lighttable I have 9 pictures
  • I do select 3 of them
  • All pictures have 2 stars
  • I press Ctrl+x to enter culling mode, I see the 3 pictures
  • I fly over one, press r (to reject)
  • The image is set to rejected all other pictures are still with 2 stars
image
  • Ctrl+x again to leave culling mode
  • Only the image I had rejected is flagged as rejected in the lighttable
image

So what's wrong? How to reproduce the issue?

@Macchiato17

Copy link
Copy Markdown
Contributor

@TurboGit I've just closed #21982 as being resolved as far as I can tell. That issue was exactly about what you tried in your reproduction steps. Current master doesn't show the issue anymore, please also see my comment in #21982. Best regards 👋

@kofa73
kofa73 marked this pull request as ready for review September 19, 2026 11:01
@kofa73

kofa73 commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator Author

Closing, the issue has been closed and is no longer reproducible.

@kofa73 kofa73 closed this Sep 19, 2026
@kofa73
kofa73 deleted the fix-21982-culling-hover-act-on branch September 19, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Culling: rating / rejecting assigned to all images selected for culling

6 participants