[nautilus/wip/corey/dnd-hack: 2/3] dnd: Cleanup calls to gdk_drop_get_actions()




commit f328288dc2e8ba7f1e801a10175d090aef33f2e9
Author: Corey Berla <corey berla me>
Date:   Tue Aug 30 20:35:00 2022 -0700

    dnd: Cleanup calls to gdk_drop_get_actions()
    
    In preparation for the next commit.

 src/gtk/nautilusgtkplacessidebar.c | 5 ++++-
 src/nautilus-window-slot-dnd.c     | 6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/gtk/nautilusgtkplacessidebar.c b/src/gtk/nautilusgtkplacessidebar.c
index fbf1470ec..76fb98627 100644
--- a/src/gtk/nautilusgtkplacessidebar.c
+++ b/src/gtk/nautilusgtkplacessidebar.c
@@ -1879,11 +1879,14 @@ drag_drop_callback (GtkDropTarget    *target,
       else
         {
           GFile *dest_file = g_file_new_for_uri (target_uri);
+          GdkDragAction actions;
+
+          actions = gdk_drop_get_actions (gtk_drop_target_get_current_drop (target));
           
           emit_drag_perform_drop (sidebar,
                                   dest_file,
                                   g_value_get_boxed (value),
-                                  gdk_drop_get_actions (gtk_drop_target_get_current_drop (target)));
+                                  actions);
 
           g_object_unref (dest_file);
         }
diff --git a/src/nautilus-window-slot-dnd.c b/src/nautilus-window-slot-dnd.c
index 8645d472d..5d7267d38 100644
--- a/src/nautilus-window-slot-dnd.c
+++ b/src/nautilus-window-slot-dnd.c
@@ -270,15 +270,19 @@ slot_proxy_handle_drop (GtkDropTarget *target,
         if (G_VALUE_HOLDS (value, GDK_TYPE_FILE_LIST))
         {
             GSList *items = g_value_get_boxed (value);
+            GdkDragAction actions;
+
             for (GSList *l = items; l != NULL; l = l->next)
             {
                 uri_list = g_list_prepend (uri_list, g_file_get_uri (l->data));
             }
 
+            actions = gdk_drop_get_actions (gtk_drop_target_get_current_drop (target));
+
             nautilus_files_view_drop_proxy_received_uris (target_view,
                                                           uri_list,
                                                           target_uri,
-                                                          gdk_drop_get_actions 
(gtk_drop_target_get_current_drop (target)));
+                                                          actions);
             g_list_free_full (uri_list, g_free);
         }
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]