[Xfce4-commits] <xfce4-panel:xfce-4.8> Tasklist: Allow both motion activation and dnd (bug #7755).
Nick Schermer
noreply at xfce.org
Tue Jun 21 22:18:06 CEST 2011
Updating branch refs/heads/xfce-4.8
to 7c88bea1dc32e7ad46fa73356351dbf0abcc3cdb (commit)
from 412495835f0cdce9e42e7a526a4b35c8d1f14ad3 (commit)
commit 7c88bea1dc32e7ad46fa73356351dbf0abcc3cdb
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).
(cherry picked from commit 98d8f4b2386bacd5f2fe90a511d7d2817d0c13d3)
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