From 89b8b65fbf04cc77e002a5eb9560e33ae2b4c7f2 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Fri, 8 Sep 2017 09:39:29 +0200 Subject: [PATCH] Prefer local (file://) URIs than native ones (smb:// for example). This allows drag and dropping files from network shares in Thunar to other applications that don't handle native URIs (Claws Mail, Chromium, Firefox...) --- thunar/thunar-gio-extensions.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/thunar/thunar-gio-extensions.c b/thunar/thunar-gio-extensions.c index d365d20..9a87091 100644 --- a/thunar/thunar-gio-extensions.c +++ b/thunar/thunar-gio-extensions.c @@ -512,7 +512,19 @@ thunar_g_file_list_to_stringv (GList *list) uris = g_new0 (gchar *, g_list_length (list) + 1); for (lp = list, n = 0; lp != NULL; lp = lp->next) - uris[n++] = g_file_get_uri (G_FILE (lp->data)); + { + /* Prefer native paths for interoperability. */ + gchar *path = g_file_get_path (G_FILE (lp->data)); + if (path == NULL) + { + uris[n++] = g_file_get_uri (G_FILE (lp->data)); + } + else + { + uris[n++] = g_filename_to_uri (path, NULL, NULL); + g_free(path); + } + } return uris; } -- 2.1.4