[Xfce4-commits] [xfce/xfdesktop] 01/01: Use clipboard target "text/uri-list" when copying/cutting (Bug #13379)

noreply at xfce.org noreply at xfce.org
Tue May 14 03:58:58 CEST 2019


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfdesktop.

commit c72148e4a7e29613503a4fd8450bdc3a53e33659
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 7ea21d9..34db416 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