Skip to content

darkroom: don't restore focus onto a collapsed module - #22695

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
masterpiga:focus-border
Oct 19, 2026
Merged

TurboGit merged 1 commit into
darktable-org:masterfrom
masterpiga:focus-border

Conversation

@masterpiga

@masterpiga masterpiga commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A follow up to #22675.

Collapsing a module drops its focus, but enter() restored the last active module's focus regardless of its expanded state. Leaving the darkroom with that module collapsed and coming back gave a focused, collapsed module.

enter() now focuses it only if it was left expanded, as the image change path already does.

Note that a module can still be focused and expanded in at least three ways (maybe more):

  • Ctrl+click on the on/off button of a collapsed module
  • The module's "focus" shortcut calls _request_module_focus_callback, which focuses without expanding
  • Widgets in the QAP

So, "collapsed and focused" is a state that can happen in the darkroom.

Therefore, this change also includes a CSS fix to ensure that collapsed and focused modules get their highlighted border, if the "focused module border" option is set:

image

Checklist

  • I have read CONTRIBUTING.md and the coding style.
  • I have not merged master into the topic branch.
  • The pull request is one logical change, and every commit compiles on its own. You may use git rebase --exec 'cmake --build build master to check this.
  • I ran the relevant tests: unit tests, src/tests/integration/ where the pixelpipe is touched, or darktable-cli as a headless smoke test.
  • New user-visible strings use _(), new preferences are registered in data/darktableconfig.xml.in.
  • A RELEASE_NOTES.md entry was added (only needed if fixing an issue in a release). Do not reference GitHub issues.

AI assistance

Co-authored with Claude.

@masterpiga masterpiga added this to the 5.8 milestone Oct 19, 2026
@masterpiga masterpiga added bugfix pull request fixing a bug priority: low core features work as expected, only secondary/optional features don't difficulty: trivial some changes in a couple of functions scope: UI user interface and interactions labels Oct 19, 2026
@TurboGit

Copy link
Copy Markdown
Member

A more principled, but maybe more controversial fix, would be to ensure that enter() always expands the focused module.

Or in enter() we clear the focus state if the module is collapsed as it makes no sense. This state cannot happen while in Darkroom, so better to clear this instead of working around it.

@masterpiga masterpiga changed the title themes: show the focused border also if a module is not expanded darkroom: don't restore focus onto a collapsed module Oct 19, 2026
@masterpiga

masterpiga commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

Thanks, PTAL.

enter() no longer restores the focus onto a collapsed module. I kept the CSS change, though, because a collapsed module can still be focused at runtime: ctrl+click on its on/off button, its focus shortcut, or its widgets in the quick access panel. Those paths focus it without expanding it, so the border should show there too.

Updated PR description accordingly.

@masterpiga
masterpiga requested a review from TurboGit October 19, 2026 10:59
Collapsing a module drops its focus, but enter() restored the last
active module's focus regardless of its expanded state. Leaving the
darkroom with that module collapsed and coming back gave a focused,
collapsed module.

enter() now focuses it only if it was left expanded, as the image
change path already does.

Note that a module can still be focused and expanded in at least
three ways (maybe more):

- Ctrl+click on the on/off button of a collapsed module
- The module's "focus" shortcut calls `_request_module_focus_callback`,
  which focuses without expanding
- Widgets in the QAP

So, "collapsed and focused" is a state that can happen in the
darkroom.

Therefore, this change also includes a CSS fix to ensure that
collapsed and focused modules get their highlighted border, if the
"focused module border" option is set.

themes: show the focused border also if a module is not expanded

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@TurboGit
TurboGit merged commit f529930 into darktable-org:master Oct 19, 2026
7 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 difficulty: trivial some changes in a couple of functions priority: low core features work as expected, only secondary/optional features don't scope: UI user interface and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants