From 8b86bbe81fa6792a7b9672202718d282b9df4d4b Mon Sep 17 00:00:00 2001 From: David Redondo Date: Wed, 6 Nov 2024 09:52:59 +0100 Subject: [PATCH] client: Fix crash on data_device_motion When a window is closed/destroyed, a motion message can still be received that was send by the compositor before closing the window. Pick-to: 6.8 Change-Id: I49cfdcf9a4143df5c090dfb93f2920879ae43f80 Reviewed-by: David Edmundson --- src/plugins/platforms/wayland/qwaylanddatadevice.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/wayland/qwaylanddatadevice.cpp b/src/plugins/platforms/wayland/qwaylanddatadevice.cpp index 095911274dc..7de41da584e 100644 --- a/src/plugins/platforms/wayland/qwaylanddatadevice.cpp +++ b/src/plugins/platforms/wayland/qwaylanddatadevice.cpp @@ -257,6 +257,9 @@ void QWaylandDataDevice::data_device_motion(uint32_t time, wl_fixed_t x, wl_fixe if (!drag && !m_dragOffer) return; + if (!m_dragWindow) + return; + m_dragPoint = calculateDragPosition(x, y, m_dragWindow); QMimeData *dragData = nullptr;