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 <laszlo.agocs@theqtcompany.com>
This commit is contained in:
parent
fc78f8239e
commit
face687a62
@ -65,21 +65,9 @@ QMimeData * QWaylandDrag::platformDropData()
|
|||||||
|
|
||||||
void QWaylandDrag::startDrag()
|
void QWaylandDrag::startDrag()
|
||||||
{
|
{
|
||||||
bool cancel = false;
|
QBasicDrag::startDrag();
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
QWaylandWindow *icon = static_cast<QWaylandWindow *>(shapedPixmapWindow()->handle());
|
QWaylandWindow *icon = static_cast<QWaylandWindow *>(shapedPixmapWindow()->handle());
|
||||||
m_display->currentInputDevice()->dataDevice()->startDrag(drag()->mimeData(), icon);
|
m_display->currentInputDevice()->dataDevice()->startDrag(drag()->mimeData(), icon);
|
||||||
if (cancel)
|
|
||||||
QBasicDrag::cancel();
|
|
||||||
QBasicDrag::startDrag();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandDrag::cancel()
|
void QWaylandDrag::cancel()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user