From 14d8ce4568a651939b8ffd12f4ea50b0635b9589 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Sun, 8 Mar 2020 09:40:45 +0000 Subject: [PATCH] Fix #713: Image preview does not update when pressing shift-up https://github.com/BestImageViewer/geeqie/issues/713 When multiple images were selected, when the selection was changed GTK triggers the selection function on every item selected in turn. This resulted in the last item in the list being shown as the selected image. The code now uses the GtkTree cursor location. --- src/view_file/view_file_list.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/view_file/view_file_list.c b/src/view_file/view_file_list.c index 4b428de0..fddca37e 100644 --- a/src/view_file/view_file_list.c +++ b/src/view_file/view_file_list.c @@ -795,11 +795,14 @@ static gboolean vflist_select_cb(GtkTreeSelection *selection, GtkTreeModel *stor { ViewFile *vf = data; GtkTreeIter iter; + GtkTreePath *cursor_path; - if (!path_currently_selected && - gtk_tree_model_get_iter(store, &iter, tpath)) + gtk_tree_view_get_cursor(GTK_TREE_VIEW(vf->listview), &cursor_path, NULL); + if (cursor_path) { + gtk_tree_model_get_iter(store, &iter, cursor_path); gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &VFLIST(vf)->select_fd, -1); + gtk_tree_path_free(cursor_path); } else { -- 2.20.1