[Xfce4-commits] <xfce4-panel:master> Don't activate windows in tasklist when dnd a button or plugin.
Nick Schermer
noreply at xfce.org
Sat Feb 19 17:06:05 CET 2011
Updating branch refs/heads/master
to c73fec644730c078bee2e0893839fb89ba89c7a6 (commit)
from 7bd1028804d7f5ffa7dc7994d7104a02375a0bc2 (commit)
commit c73fec644730c078bee2e0893839fb89ba89c7a6
Author: Nick Schermer <nick at xfce.org>
Date: Sat Feb 19 16:16:12 2011 +0100
Don't activate windows in tasklist when dnd a button or plugin.
plugins/tasklist/tasklist-widget.c | 30 +++++++++++++++++++++---------
1 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index e6c7bfb..15ff7bf 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -1887,19 +1887,31 @@ xfce_tasklist_child_drag_motion (XfceTasklistChild *child,
gint y,
guint timestamp)
{
+ GtkWidget *dnd_widget;
+
panel_return_val_if_fail (XFCE_IS_TASKLIST (child->tasklist), FALSE);
- child->motion_timestamp = timestamp;
- if (child->motion_timeout_id == 0
- && !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (child->button)))
+ /* don't respond to dragging our own children or panel plugins */
+ dnd_widget = gtk_drag_get_source_widget (context);
+ if (dnd_widget == NULL
+ || gtk_widget_get_parent (dnd_widget) != GTK_WIDGET (child->tasklist)
+ || XFCE_IS_PANEL_PLUGIN (dnd_widget))
{
- child->motion_timeout_id = g_timeout_add_full (G_PRIORITY_LOW, DRAG_ACTIVATE_TIMEOUT,
- xfce_tasklist_child_drag_motion_timeout, child,
- xfce_tasklist_child_drag_motion_timeout_destroyed);
- }
+ child->motion_timestamp = timestamp;
+ if (child->motion_timeout_id == 0
+ && !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (child->button)))
+ {
+ child->motion_timeout_id = g_timeout_add_full (G_PRIORITY_LOW, DRAG_ACTIVATE_TIMEOUT,
+ xfce_tasklist_child_drag_motion_timeout, child,
+ xfce_tasklist_child_drag_motion_timeout_destroyed);
+ }
- /* keep emitting the signal */
- gdk_drag_status (context, 0, timestamp);
+ /* keep emitting the signal */
+ gdk_drag_status (context, 0, timestamp);
+
+ /* we want to receive leave signal as well */
+ return TRUE;
+ }
/* also send drag-motion to other widgets */
return FALSE;
More information about the Xfce4-commits
mailing list