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>
This commit is contained in:
parent
d62f2bc4e7
commit
ef259af2db
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user