From 7f9dc97115bb59b62b92f58c8fb01697f15e5a10 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 20 Jul 2026 17:36:28 +0300 Subject: grid: sync flowbox selection to navigator.current on Enter/t (cu0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Arrow-key navigation in the grid moved the GtkFlowBox selection but never updated navigator.current, so Enter (and toggling to large with t) opened the stale current image instead of the highlighted one. _on_flow_key emitted the activate signal directly without syncing, unlike the double-click path (_on_child_activated) which does sync. Add ggaze_grid_sync_current(): reads the selected flowbox child and calls navigator_set_current_file. Call it from _on_flow_key before emitting activate, and from _action_toggle_view's grid→large branch (then load the now-current image). Mirrors the existing double-click sync. --- src/window.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index 688f879..d978be3 100644 --- a/src/window.c +++ b/src/window.c @@ -243,7 +243,13 @@ _action_toggle_view(GSimpleAction *p_a, GVariant *p_v, gpointer p_data) { if (g_strcmp0(c_cur, "large") == 0) { gtk_stack_set_visible_child_name(GTK_STACK(p_win->p_stack), "grid"); } else { + /* Leaving the grid: sync navigator.current to the highlighted cell so + * the large view opens the selected image, then load it. */ + if (p_win->p_grid != NULL) { + ggaze_grid_sync_current(p_win->p_grid); + } gtk_stack_set_visible_child_name(GTK_STACK(p_win->p_stack), "large"); + _load_current(p_win); } } -- cgit v1.2.3