diff --git a/containments/desktop/plugins/folder/foldermodel.cpp b/containments/desktop/plugins/folder/foldermodel.cpp --- a/containments/desktop/plugins/folder/foldermodel.cpp +++ b/containments/desktop/plugins/folder/foldermodel.cpp @@ -723,6 +723,12 @@ void FolderModel::dragSelected(int x, int y) { + if (m_dragInProgress) { + return; + } + + m_dragInProgress = true; + // Avoid starting a drag synchronously in a mouse handler or interferes with // child event filtering in parent items (and thus e.g. press-and-hold hand- // ling in a containment). @@ -734,6 +740,7 @@ void FolderModel::dragSelectedInternal(int x, int y) { if (!m_viewAdapter || !m_selectionModel->hasSelection()) { + m_dragInProgress = false; return; } @@ -760,7 +767,6 @@ drag->setMimeData(m_dirModel->mimeData(sourceDragIndexes)); item->grabMouse(); - m_dragInProgress = true; drag->exec(supportedDragActions()); m_dragInProgress = false; item->ungrabMouse();