From 885a708e69d57d284343b282c916db507979d7ff Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 7 Aug 2024 18:38:34 +0100 Subject: [PATCH] client: Notify application code of button release after leave There is a code path to notify application code that mouse buttons are released following a drag. Compositors we will have been sent a leave event in the meantime, making this code inert. Focus window will be null, and mButtons will be empty. We still need to send a release event QWindowSystem event to no window, as we need to update any grabs on the device. Pick-to: 6.8 Change-Id: I2a090561c7d3f4669ab2dbc4eb86c8226fe15d1a Fixes: QTBUG-127821 Reviewed-by: David Redondo --- src/plugins/platforms/wayland/qwaylandinputdevice.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index 03cb2707330..afbb3879b6d 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -833,15 +833,7 @@ void QWaylandInputDevice::Pointer::invalidateFocus() void QWaylandInputDevice::Pointer::releaseButtons() { - if (mButtons == Qt::NoButton) - return; - - mButtons = Qt::NoButton; - - if (auto *window = focusWindow()) { - ReleaseEvent e(focusWindow(), mParent->mTime, mSurfacePos, mGlobalPos, mButtons, mLastButton, mParent->modifiers()); - window->handleMouse(mParent, e); - } + setFrameEvent(new ReleaseEvent(nullptr, mParent->mTime, mSurfacePos, mGlobalPos, Qt::NoButton, Qt::NoButton, mParent->modifiers())); } void QWaylandInputDevice::Pointer::leavePointers()