From 6eec8e7360aaa7db9aec9d9247d38060633041fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?=
Date: Tue, 16 Nov 2021 14:02:26 +0100 Subject: [PATCH] Fix adding images to the list of recent files --- fastiv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fastiv.c b/fastiv.c index f006e3f..5e75d6b 100644 --- a/fastiv.c +++ b/fastiv.c @@ -153,7 +153,12 @@ open(const gchar *path) return; } - gtk_recent_manager_add_item(gtk_recent_manager_get_default(), path); + gchar *uri = g_filename_to_uri(path, NULL, NULL); + if (uri) { + gtk_recent_manager_add_item(gtk_recent_manager_get_default(), path); + g_free(uri); + } + gtk_window_set_title(GTK_WINDOW(g.window), path); gtk_stack_set_visible_child(GTK_STACK(g.stack), g.view_scroller);