summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Hein <hein@kde.org>2017-01-11 17:23:42 (GMT)
committerEike Hein <hein@kde.org>2017-01-11 17:44:57 (GMT)
commitfc8ce43ac026d1b9769d8bfe98b42d74a74bc8db (patch)
tree3c17dc5033122bca18549e527a54815b34781b72
parent05920ab34283dd91d6575e6f479c14b63a258c60 (diff)
Fix crash during crash acrobatics.
Summary: Mark drag in progress earlier and use it to avoid queuing two drags, avoid nesting QDrag::exec. BUG:365206 Reviewers: davidedmundson Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D4085
-rw-r--r--containments/desktop/plugins/folder/foldermodel.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/containments/desktop/plugins/folder/foldermodel.cpp b/containments/desktop/plugins/folder/foldermodel.cpp
index 9e88aa9..758f7f3 100644
--- a/containments/desktop/plugins/folder/foldermodel.cpp
+++ b/containments/desktop/plugins/folder/foldermodel.cpp
@@ -723,6 +723,12 @@ void FolderModel::addDragImage(QDrag *drag, int x, int y)
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::dragSelected(int x, int y)
void FolderModel::dragSelectedInternal(int x, int y)
{
if (!m_viewAdapter || !m_selectionModel->hasSelection()) {
+ m_dragInProgress = false;
return;
}
@@ -760,7 +767,6 @@ void FolderModel::dragSelectedInternal(int x, int y)
drag->setMimeData(m_dirModel->mimeData(sourceDragIndexes));
item->grabMouse();
- m_dragInProgress = true;
drag->exec(supportedDragActions());
m_dragInProgress = false;
item->ungrabMouse();