Don't crash if we start a drag without dragFocus
Sometimes origin will be nullptr, triggering a crash. [ChangeLog][QPA plugin] Fixed a crash that sometimes happened when starting a drag-and-drop operation. Fixes: QTBUG-76368 Change-Id: I8f4e6b05f073644834c3c72a8307dac5b897f626 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
This commit is contained in:
parent
4a9a5e2f62
commit
002fade629
@ -111,7 +111,10 @@ void QWaylandDataDevice::startDrag(QMimeData *mimeData, QWaylandWindow *icon)
|
||||
if (!origin)
|
||||
origin = m_display->currentInputDevice()->touchFocus();
|
||||
|
||||
if (origin)
|
||||
start_drag(m_dragSource->object(), origin->object(), icon->object(), m_display->currentInputDevice()->serial());
|
||||
else
|
||||
qCDebug(lcQpaWayland) << "Couldn't start a drag because the origin window could not be found.";
|
||||
}
|
||||
|
||||
void QWaylandDataDevice::cancelDrag()
|
||||
|
Loading…
x
Reference in New Issue
Block a user