From face687a6204a8f41b0bbe26de1e42c9dc7cb7e0 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Thu, 29 Oct 2015 16:35:27 +0200 Subject: [PATCH] Fix deadlock when starting a drag With commit c55a36cb9015cf1eebd49eaa5b1b4f4ec9b28451 in qtbase the QSimpleDrag code changed in a way that caused a deadlock due to drawing a window without a role. However, thanks to that we can now remove that start/cancel hack and simplify the code. Change-Id: Icba6e7c9c4927855e48fb21632db1a10332c4ffb Reviewed-by: Laszlo Agocs --- src/plugins/platforms/wayland/qwaylanddnd.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylanddnd.cpp b/src/plugins/platforms/wayland/qwaylanddnd.cpp index 59f91411f03..e195d193a41 100644 --- a/src/plugins/platforms/wayland/qwaylanddnd.cpp +++ b/src/plugins/platforms/wayland/qwaylanddnd.cpp @@ -65,21 +65,9 @@ QMimeData * QWaylandDrag::platformDropData() void QWaylandDrag::startDrag() { - bool cancel = false; - if (!shapedPixmapWindow()) { - QBasicDrag::startDrag(); - // 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; - } - + QBasicDrag::startDrag(); QWaylandWindow *icon = static_cast(shapedPixmapWindow()->handle()); m_display->currentInputDevice()->dataDevice()->startDrag(drag()->mimeData(), icon); - if (cancel) - QBasicDrag::cancel(); - QBasicDrag::startDrag(); } void QWaylandDrag::cancel()