aboutsummaryrefslogtreecommitdiff
path: root/fastiv.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-20 12:45:05 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-20 12:45:33 +0100
commit75994cd85aa6d207d8867f03ec3759de0b435b23 (patch)
treecd2499833e81f034e46070848359620a9bdce18b /fastiv.c
parent3e9a388537642592736b004a8acc9d826885d922 (diff)
downloadfiv-75994cd85aa6d207d8867f03ec3759de0b435b23.tar.gz
fiv-75994cd85aa6d207d8867f03ec3759de0b435b23.tar.xz
fiv-75994cd85aa6d207d8867f03ec3759de0b435b23.zip
Make a middle click open items in a new instance
Diffstat (limited to 'fastiv.c')
-rw-r--r--fastiv.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/fastiv.c b/fastiv.c
index a8206ff..f37e9f8 100644
--- a/fastiv.c
+++ b/fastiv.c
@@ -266,13 +266,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)
{
char *argv[] = {PROJECT_NAME, (char *) path, NULL};
@@ -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)
{