From 67d5bfcfce1f4d1cca337da411d450e8c8279738 Mon Sep 17 00:00:00 2001 From: o9000 Date: Sat, 28 Mar 2015 21:15:30 +0000 Subject: [PATCH] Sort tasks on taskbar: handle task drag and drop (disabled, work in progress) - issue 478 git-svn-id: http://tint2.googlecode.com/svn/trunk@742 121b4492-b84c-0410-8b4c-0d4edfb3f3cc --- src/tint.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/tint.c b/src/tint.c index 1ca11a5..04aed05 100644 --- a/src/tint.c +++ b/src/tint.c @@ -462,21 +462,22 @@ void event_button_motion_notify (XEvent *e) // If the event takes place on the same taskbar as the task being dragged if(event_taskbar == task_drag->area.parent) { - // Swap the task_drag with the task on the event's location (if they differ) - if(event_task && event_task != task_drag) { - GSList * drag_iter = g_slist_find(event_taskbar->area.list, task_drag); - GSList * task_iter = g_slist_find(event_taskbar->area.list, event_task); - if(drag_iter && task_iter) { - gpointer temp = task_iter->data; - task_iter->data = drag_iter->data; - drag_iter->data = temp; - event_taskbar->area.resize = 1; - panel_refresh = 1; - task_dragged = 1; - } - } if (sort_tasks_method == TASKBAR_SORT_POSITION) { sort_tasks(event_taskbar); + } else { + // Swap the task_drag with the task on the event's location (if they differ) + if(event_task && event_task != task_drag) { + GSList * drag_iter = g_slist_find(event_taskbar->area.list, task_drag); + GSList * task_iter = g_slist_find(event_taskbar->area.list, event_task); + if(drag_iter && task_iter) { + gpointer temp = task_iter->data; + task_iter->data = drag_iter->data; + drag_iter->data = temp; + event_taskbar->area.resize = 1; + panel_refresh = 1; + task_dragged = 1; + } + } } } else { // The event is on another taskbar than the task being dragged