[Xfce4-commits] [xfce/xfdesktop] 02/02: Use clipboard target "text/uri-list" when copying/cutting (Bug #13379)
noreply at xfce.org
noreply at xfce.org
Tue Jun 4 21:43:43 CEST 2019
This is an automated email from the git hooks/post-receive script.
a l e x p u s h e d a c o m m i t t o b r a n c h x f c e - 4 . 1 2
in repository xfce/xfdesktop.
commit 0bb9106ef9cc5b3dcf8d6851b85f67878944522f
Author: Andre Miranda <andreldm at xfce.org>
Date: Mon May 13 22:55:55 2019 -0300
Use clipboard target "text/uri-list" when copying/cutting (Bug #13379)
---
src/xfdesktop-clipboard-manager.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/xfdesktop-clipboard-manager.c b/src/xfdesktop-clipboard-manager.c
index a02dacc..8a72d6f 100644
--- a/src/xfdesktop-clipboard-manager.c
+++ b/src/xfdesktop-clipboard-manager.c
@@ -59,6 +59,7 @@ enum
enum
{
+ TARGET_TEXT_URI_LIST,
TARGET_GNOME_COPIED_FILES,
TARGET_UTF8_STRING,
};
@@ -130,6 +131,7 @@ typedef struct
static const GtkTargetEntry clipboard_targets[] =
{
+ { "text/uri-list", 0, TARGET_TEXT_URI_LIST },
{ "x-special/gnome-copied-files", 0, TARGET_GNOME_COPIED_FILES },
{ "UTF8_STRING", 0, TARGET_UTF8_STRING }
};
@@ -462,6 +464,7 @@ xfdesktop_clipboard_manager_get_callback (GtkClipboard *clipboard,
GList *file_list = NULL;
gchar *string_list;
gchar *data;
+ gchar **uris;
g_return_if_fail (GTK_IS_CLIPBOARD (clipboard));
g_return_if_fail (XFDESKTOP_IS_CLIPBOARD_MANAGER (manager));
@@ -475,6 +478,12 @@ xfdesktop_clipboard_manager_get_callback (GtkClipboard *clipboard,
switch (target_info)
{
+ case TARGET_TEXT_URI_LIST:
+ uris = xfdesktop_file_utils_file_list_to_uri_array (file_list);
+ gtk_selection_data_set_uris (selection_data, uris);
+ g_strfreev (uris);
+ break;
+
case TARGET_GNOME_COPIED_FILES:
data = g_strconcat (manager->files_cutted ? "cut\n" : "copy\n", string_list, NULL);
gtk_selection_data_set (selection_data,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list