summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-02-04 20:02:59 +0200
committerGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-02-05 07:42:06 +0000
commitaf3cc691951b5ba84111aff204e65bf258848f3d (patch)
tree4db2b39db7f6fa3137090448dd25a003d9f9106e
parentd15c0db0c84109c405d4fb0752e2a0cfde5606b0 (diff)
downloadqtwayland-af3cc691951b5ba84111aff204e65bf258848f3d.tar.gz
Fix deadlock when starting a drag
Change-Id: Ie2fdc56bffb97ce04ffad11ea7a7686dc09a06cc Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
-rw-r--r--src/client/qwaylanddnd.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/qwaylanddnd.cpp b/src/client/qwaylanddnd.cpp
index 996e647c..e38e23da 100644
--- a/src/client/qwaylanddnd.cpp
+++ b/src/client/qwaylanddnd.cpp
@@ -71,13 +71,20 @@ QMimeData * QWaylandDrag::platformDropData()
void QWaylandDrag::startDrag()
{
+ bool cancel = false;
if (!shapedPixmapWindow()) {
QBasicDrag::startDrag();
- QBasicDrag::cancel();
+ // Don't call cancel() here, since that will hide 'shapedPixmapWindow()', and
+ // QWaylandWindow::setVisible(false) will flush the window system queue,
+ // ending up trying to render the window, which doesn't have a role yet,
+ // and so blocking waiting for a frame callback.
+ cancel = true;
}
QWaylandWindow *icon = static_cast<QWaylandWindow *>(shapedPixmapWindow()->handle());
m_display->currentInputDevice()->dataDevice()->startDrag(drag()->mimeData(), icon);
+ if (cancel)
+ QBasicDrag::cancel();
QBasicDrag::startDrag();
}