From e349e5529d507ed65d443a1cc1fce95e26901516 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Wed, 12 Jun 2024 15:44:41 +0200 Subject: [PATCH] QWaylandDataDevice: Use lastInputWindow as source Currently we only consider the pointer focus and touch focus window, but not tablet input Pick-to: 6.8 6.7 Change-Id: I62558a9b6362c9d773fbdf8949468529ee83bffe Reviewed-by: Vlad Zahorodnii --- src/plugins/platforms/wayland/qwaylanddatadevice.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylanddatadevice.cpp b/src/plugins/platforms/wayland/qwaylanddatadevice.cpp index 30bfb86c571..095911274dc 100644 --- a/src/plugins/platforms/wayland/qwaylanddatadevice.cpp +++ b/src/plugins/platforms/wayland/qwaylanddatadevice.cpp @@ -85,10 +85,7 @@ QWaylandDataOffer *QWaylandDataDevice::dragOffer() const bool QWaylandDataDevice::startDrag(QMimeData *mimeData, Qt::DropActions supportedActions, QWaylandWindow *icon) { - auto *seat = m_display->currentInputDevice(); - auto *origin = seat->pointerFocus(); - if (!origin) - origin = seat->touchFocus(); + auto *origin = m_display->lastInputWindow(); if (!origin) { qCDebug(lcQpaWayland) << "Couldn't start a drag because the origin window could not be found."; @@ -161,7 +158,7 @@ bool QWaylandDataDevice::startDrag(QMimeData *mimeData, Qt::DropActions supporte } } - start_drag(m_dragSource->object(), origin->wlSurface(), icon->wlSurface(), m_display->currentInputDevice()->serial()); + start_drag(m_dragSource->object(), origin->wlSurface(), icon->wlSurface(), m_display->lastInputSerial()); return true; }