From 75f0c192121fae584a074e881ca6fc103e598c2d Mon Sep 17 00:00:00 2001 From: Arecsu Date: Sun, 9 Aug 2026 20:28:55 -0300 Subject: [PATCH] fix: refresh lighttable layout buttons when leaving full preview 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 #21782. --- src/views/lighttable.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/views/lighttable.c b/src/views/lighttable.c index 162788d03374..3bba4308edf6 100644 --- a/src/views/lighttable.c +++ b/src/views/lighttable.c @@ -110,6 +110,12 @@ static void _preview_quit(dt_view_t *self) // restore panels dt_ui_restore_panels(darktable.gui->ui); + // refresh the layout buttons: exiting full preview via a path that doesn't + // go through the layout button handlers (e.g. closing the main window while + // in preview, which exits preview instead of quitting dt) would otherwise + // leave the full preview icon stuck in its active state. + dt_view_lighttable_update_layout_buttons(darktable.view_manager); + // show/hide filmstrip & timeline when entering the view if(lib->current_layout == DT_LIGHTTABLE_LAYOUT_CULLING || lib->current_layout == DT_LIGHTTABLE_LAYOUT_CULLING_DYNAMIC)