From 75994cd85aa6d207d8867f03ec3759de0b435b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sat, 20 Nov 2021 12:45:05 +0100 Subject: Make a middle click open items in a new instance --- fastiv.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'fastiv.c') diff --git a/fastiv.c b/fastiv.c index a8206ff..f37e9f8 100644 --- a/fastiv.c +++ b/fastiv.c @@ -265,13 +265,6 @@ on_next(void) } } -static void -on_item_activated(G_GNUC_UNUSED FastivBrowser *browser, const char *path, - G_GNUC_UNUSED gpointer data) -{ - open(path); -} - static void spawn_path(const char *path) { @@ -282,6 +275,16 @@ spawn_path(const char *path) g_clear_error(&error); } +static void +on_item_activated(G_GNUC_UNUSED FastivBrowser *browser, const char *path, + GtkPlacesOpenFlags flags, G_GNUC_UNUSED gpointer data) +{ + if (flags == GTK_PLACES_OPEN_NEW_WINDOW) + spawn_path(path); + else + open(path); +} + static gboolean open_any_path(const char *path) { -- cgit v1.2.3