Skip to content

fix: refresh lighttable layout buttons when leaving full preview - #21785

Open
Arecsu wants to merge 1 commit into
darktable-org:masterfrom
Arecsu:fix/preview-icon-stuck-after-window-close
Open

fix: refresh lighttable layout buttons when leaving full preview#21785
Arecsu wants to merge 1 commit into
darktable-org:masterfrom
Arecsu:fix/preview-icon-stuck-after-window-close

Conversation

@Arecsu

@Arecsu Arecsu commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Fixes the side observation in #21782 — closing the main window while in full preview (which exits preview instead of quitting darktable) left the full-preview layout icon stuck in its active state, even though the view had dropped back to the file manager. The icon only corrected itself after the next layout button interaction.

The icons are driven declaratively from the view state: dt_view_lighttable_update_layout_buttons()_lib_lighttable_update_btn() re-declares the active button from the layout and preview flags, so any state change that skips that refresh leaves the icons stale. _preview_quit() clears the preview flag and restores the thumbtable but never refreshed the buttons.

The fix calls dt_view_lighttable_update_layout_buttons() from _preview_quit() — the single canonical "preview off" path — so window close, the layout buttons and the accelerators all keep the toolbar in sync.

Note: the buggy code path exists identically in 5.6, so this predates the event-controller conversion; the conversion (where the icons became purely declarative) just made the missing refresh observable.

CC @wpferguson

Closing the main window while in full preview exits preview instead of
quitting darktable, but left the full-preview layout icon stuck in its
active state: _preview_quit() cleared the preview flag and restored the
file manager thumbtable without refreshing the layout buttons.  The
icons are driven declaratively from the view state via
_lib_lighttable_update_btn(), so they only corrected themselves after
the next layout button interaction.

Refresh the buttons from _preview_quit() -- the single canonical
"preview off" path -- so every exit route (window close, layout
buttons, accelerators) keeps the toolbar icons in sync.

Reported as a side observation in darktable-org#21782.
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.

1 participant