[gnome-panel/wip/muktupavels/remove-drag-source: 2/4] launcher: remove also drag source



commit fa7727661132e15a4e288e92211a0cb8a2b18501
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Apr 12 22:29:59 2020 +0300

    launcher: remove also drag source
    
    Launchers are meant to launch things...

 gnome-panel/applet.c   |  2 --
 gnome-panel/launcher.c | 64 --------------------------------------------------
 gnome-panel/launcher.h |  3 ---
 3 files changed, 69 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index d463dd008..fa4698dc8 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -50,7 +50,6 @@ panel_applet_set_dnd_enabled (AppletInfo *info,
 {
        switch (info->type) {
        case PANEL_OBJECT_LAUNCHER:
-               panel_launcher_set_dnd_enabled (info->data, dnd_enabled);
                break;
        case PANEL_OBJECT_APPLET:
                break;
@@ -62,7 +61,6 @@ panel_applet_set_dnd_enabled (AppletInfo *info,
                g_assert_not_reached ();
                break;
        }
-
 }
 
 static void
diff --git a/gnome-panel/launcher.c b/gnome-panel/launcher.c
index 2afba97d4..2db8585ab 100644
--- a/gnome-panel/launcher.c
+++ b/gnome-panel/launcher.c
@@ -568,36 +568,6 @@ drag_drop_cb (GtkWidget            *widget,
        return TRUE;
 }
 
-enum {
-       TARGET_URI_LIST
-};
-
-static void  
-drag_data_get_cb (GtkWidget        *widget,
-                 GdkDragContext   *context,
-                 GtkSelectionData *selection_data,
-                 guint             info,
-                 guint             time,
-                 Launcher         *launcher)
-{
-       char *location;
-       
-       g_return_if_fail (launcher != NULL);
-
-       location = launcher->location;
-
-       if (info == TARGET_URI_LIST) {
-               char *uri[2];
-
-               uri[0] = panel_launcher_get_uri (location);
-               uri[1] = NULL;
-
-               gtk_selection_data_set_uris (selection_data, uri);
-
-               g_free (uri[0]);
-       }
-}
-
 static Launcher *
 create_launcher (const char *location)
 {
@@ -686,15 +656,9 @@ create_launcher (const char *location)
 
        gtk_widget_show (launcher->button);
 
-       /*gtk_drag_dest_set (GTK_WIDGET (launcher->button),
-                          GTK_DEST_DEFAULT_ALL,
-                          dnd_targets, 2,
-                          GDK_ACTION_COPY);*/
        gtk_drag_dest_set (GTK_WIDGET (launcher->button),
                           0, NULL, 0, 0);
 
-       g_signal_connect (launcher->button, "drag_data_get",
-                          G_CALLBACK (drag_data_get_cb), launcher);
        g_signal_connect (launcher->button, "drag_data_received",
                           G_CALLBACK (drag_data_received_cb), launcher);
        g_signal_connect (launcher->button, "drag_motion",
@@ -1219,31 +1183,3 @@ panel_launcher_create (PanelToplevel       *toplevel,
                                       pack_type, pack_index,
                                       location);
 }
-
-void
-panel_launcher_set_dnd_enabled (Launcher *launcher,
-                               gboolean  dnd_enabled)
-{
-       GdkPixbuf *pixbuf;
-
-       if (dnd_enabled) {
-               static GtkTargetEntry dnd_targets[] = {
-                       { (gchar *) "text/uri-list", 0, TARGET_URI_LIST }
-               };
-
-               gtk_widget_set_has_window (launcher->button, TRUE);
-               gtk_drag_source_set (launcher->button,
-                                    GDK_BUTTON1_MASK,
-                                    dnd_targets, 2,
-                                    GDK_ACTION_COPY | GDK_ACTION_MOVE);
-               //FIXME: this doesn't work since the pixbuf isn't loaded yet
-               pixbuf = button_widget_get_pixbuf (BUTTON_WIDGET (launcher->button));
-               if (pixbuf) {
-                       gtk_drag_source_set_icon_pixbuf (launcher->button,
-                                                        pixbuf);
-                       g_object_unref (pixbuf);
-               }
-               gtk_widget_set_has_window (launcher->button, FALSE);
-       } else
-               gtk_drag_source_unset (launcher->button);
-}
diff --git a/gnome-panel/launcher.h b/gnome-panel/launcher.h
index 41e94a01c..875078ab5 100644
--- a/gnome-panel/launcher.h
+++ b/gnome-panel/launcher.h
@@ -59,9 +59,6 @@ void          ask_about_launcher              (const char *file,
 
 void            launcher_properties_destroy     (Launcher *launcher);
 
-void            panel_launcher_set_dnd_enabled  (Launcher *launcher,
-                                                gboolean  dnd_enabled);
-
 G_END_DECLS
 
 #endif


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