diff options
Diffstat (limited to 'kicker/taskbar/taskcontainer.cpp')
-rw-r--r-- | kicker/taskbar/taskcontainer.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/kicker/taskbar/taskcontainer.cpp b/kicker/taskbar/taskcontainer.cpp index d63166bb8..484a85659 100644 --- a/kicker/taskbar/taskcontainer.cpp +++ b/kicker/taskbar/taskcontainer.cpp @@ -1393,12 +1393,19 @@ void TaskContainer::publishIconGeometry( TQPoint global ) void TaskContainer::dragEnterEvent( TQDragEnterEvent* e ) { - // ignore task drags and applet drags - if (TaskDrag::canDecode(e) || PanelDrag::canDecode(e)) + // ignore applet drags + if (PanelDrag::canDecode(e)) { return; } + if (TaskDrag::canDecode(e) && READ_MERGED_TASBKAR_SETTING(allowDragAndDropReArrange)) + { + if (!READ_MERGED_TASBKAR_SETTING(sortByApp)) { + e->accept(); + } + } + // if a dragitem is held for over a taskbutton for two seconds, // activate corresponding window if (m_filteredTasks.isEmpty()) @@ -1415,6 +1422,27 @@ void TaskContainer::dragEnterEvent( TQDragEnterEvent* e ) TQToolButton::dragEnterEvent( e ); } +void TaskContainer::dropEvent( TQDropEvent* e ) +{ + // Ignore all drops except tasks + if (!TaskDrag::canDecode(e)) { + return; + } + + if (TaskDrag::canDecode(e) && READ_MERGED_TASBKAR_SETTING(allowDragAndDropReArrange)) + { + if (!READ_MERGED_TASBKAR_SETTING(sortByApp)) { + if (taskBar->taskMoveHandler(TQWidget::mapTo(taskBar, e->pos()), TaskDrag::decode(e))) { + e->accept(); + } + } + } + + dragSwitchTimer.stop(); + + TQToolButton::dropEvent( e ); +} + void TaskContainer::dragLeaveEvent( TQDragLeaveEvent* e ) { dragSwitchTimer.stop(); |