[Xfce4-commits] <xfce4-panel:master> Tasklist: Allow both motion activation and dnd (bug #7755).

Nick Schermer noreply at xfce.org
Tue Jun 21 18:22:01 CEST 2011


Updating branch refs/heads/master
         to 98d8f4b2386bacd5f2fe90a511d7d2817d0c13d3 (commit)
       from dbc73e9c47b381b87c7a5c60ab633fbc370e21f1 (commit)

commit 98d8f4b2386bacd5f2fe90a511d7d2817d0c13d3
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Jun 21 18:19:47 2011 +0200

    Tasklist: Allow both motion activation and dnd (bug #7755).

 plugins/tasklist/tasklist-widget.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index ac383d6..30e0100 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -1929,7 +1929,8 @@ xfce_tasklist_child_drag_motion (XfceTasklistChild *child,
                                  gint               y,
                                  guint              timestamp)
 {
-  GtkWidget *dnd_widget;
+  GtkWidget     *dnd_widget;
+  GdkDragAction  action;
 
   panel_return_val_if_fail (XFCE_IS_TASKLIST (child->tasklist), FALSE);
 
@@ -1954,6 +1955,14 @@ xfce_tasklist_child_drag_motion (XfceTasklistChild *child,
       /* we want to receive leave signal as well */
       return TRUE;
     }
+  else if (gtk_drag_dest_find_target (child->button, context, NULL) != GDK_NONE)
+    {
+      /* dnd to reorder buttons */
+      action = gdk_drag_context_get_suggested_action (context);
+      gdk_drag_status (context, action, timestamp);
+
+      return TRUE;
+    }
 
   /* also send drag-motion to other widgets */
   return FALSE;
@@ -2966,7 +2975,7 @@ xfce_tasklist_button_new (WnckWindow   *window,
   gtk_drag_source_set (child->button, GDK_BUTTON1_MASK,
                        source_targets, G_N_ELEMENTS (source_targets),
                        GDK_ACTION_MOVE);
-  gtk_drag_dest_set (child->button, GTK_DEST_DEFAULT_ALL,
+  gtk_drag_dest_set (child->button, GTK_DEST_DEFAULT_DROP,
                      source_targets, G_N_ELEMENTS (source_targets),
                      GDK_ACTION_MOVE);
   g_signal_connect (G_OBJECT (child->button), "drag-data-get",



More information about the Xfce4-commits mailing list