[nautilus] pathbar: Remove drag-source handling



commit 292f43d3f7177510c4146121f15c2d71e68106b7
Author: António Fernandes <AntonioJPFernandes gmail com>
Date:   Thu Aug 17 11:23:23 2017 +0100

    pathbar: Remove drag-source handling
    
    So users can drag the window from the buttons of the pathbar too, as it
    seems it's more important feature for them instead of dnd the path in
    the pathbar, which is also quite undiscoverable.
    
    As per commit d379767851ac3dc28b1108d87b60ac0cad6c4c4a
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785619

 src/nautilus-pathbar.c |   72 ------------------------------------------------
 1 files changed, 0 insertions(+), 72 deletions(-)
---
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index b750ffd..4217913 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -1671,15 +1671,6 @@ button_event_cb (GtkWidget      *button,
     return GDK_EVENT_PROPAGATE;
 }
 
-static void
-button_drag_begin_cb (GtkWidget      *widget,
-                      GdkDragContext *drag_context,
-                      gpointer        user_data)
-{
-    g_object_set_data (G_OBJECT (widget), "handle-button-release",
-                       GINT_TO_POINTER (FALSE));
-}
-
 static GIcon *
 get_gicon_for_mount (ButtonData *button_data)
 {
@@ -1844,66 +1835,6 @@ setup_button_type (ButtonData      *button_data,
 }
 
 static void
-button_drag_data_get_cb (GtkWidget        *widget,
-                         GdkDragContext   *context,
-                         GtkSelectionData *selection_data,
-                         guint             info,
-                         guint             time_,
-                         gpointer          user_data)
-{
-    ButtonData *button_data;
-    char *uri_list[2];
-    char *tmp;
-
-    button_data = user_data;
-
-    uri_list[0] = g_file_get_uri (button_data->path);
-    uri_list[1] = NULL;
-
-    if (info == NAUTILUS_ICON_DND_GNOME_ICON_LIST)
-    {
-        tmp = g_strdup_printf ("%s\r\n", uri_list[0]);
-        gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data),
-                                8, (const guchar *) tmp, strlen (tmp));
-        g_free (tmp);
-    }
-    else if (info == NAUTILUS_ICON_DND_URI_LIST)
-    {
-        gtk_selection_data_set_uris (selection_data, uri_list);
-    }
-
-    g_free (uri_list[0]);
-}
-
-static void
-setup_button_drag_source (ButtonData *button_data)
-{
-    GtkTargetList *target_list;
-    const GtkTargetEntry targets[] =
-    {
-        { NAUTILUS_ICON_DND_GNOME_ICON_LIST_TYPE, 0, NAUTILUS_ICON_DND_GNOME_ICON_LIST }
-    };
-
-    gtk_drag_source_set (button_data->button,
-                         GDK_BUTTON1_MASK |
-                         GDK_BUTTON2_MASK,
-                         NULL, 0,
-                         GDK_ACTION_MOVE |
-                         GDK_ACTION_COPY |
-                         GDK_ACTION_LINK |
-                         GDK_ACTION_ASK);
-
-    target_list = gtk_target_list_new (targets, G_N_ELEMENTS (targets));
-    gtk_target_list_add_uri_targets (target_list, NAUTILUS_ICON_DND_URI_LIST);
-    gtk_drag_source_set_target_list (button_data->button, target_list);
-    gtk_target_list_unref (target_list);
-
-    g_signal_connect (button_data->button, "drag-data-get",
-                      G_CALLBACK (button_drag_data_get_cb),
-                      button_data);
-}
-
-static void
 button_data_file_changed (NautilusFile *file,
                           ButtonData   *button_data)
 {
@@ -2114,11 +2045,8 @@ make_button_data (NautilusPathBar *path_bar,
     g_signal_connect (button_data->button, "clicked", G_CALLBACK (button_clicked_cb), button_data);
     g_signal_connect (button_data->button, "button-press-event", G_CALLBACK (button_event_cb), button_data);
     g_signal_connect (button_data->button, "button-release-event", G_CALLBACK (button_event_cb), 
button_data);
-    g_signal_connect (button_data->button, "drag-begin", G_CALLBACK (button_drag_begin_cb), button_data);
     g_object_weak_ref (G_OBJECT (button_data->button), (GWeakNotify) button_data_free, button_data);
 
-    setup_button_drag_source (button_data);
-
     nautilus_drag_slot_proxy_init (button_data->button, button_data->file, NULL);
 
     g_object_unref (path);


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