diff options
author | Liang Qi <liang.qi@qt.io> | 2022-03-09 10:47:42 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-03-10 13:48:54 +0000 |
commit | d66f01e2d74d11d48b6de95c8b1ad05081cfdacd (patch) | |
tree | 39aa02048f1c3cc2639af6adbecf718085a0b5de | |
parent | 48bdfa057910f5f7f7e9938bb69584c8638e286b (diff) | |
download | qtwayland-d66f01e2d74d11d48b6de95c8b1ad05081cfdacd.tar.gz |
client: update button state and etc in pointer_leave()
The cleanup work needs to be done even the surface is null, for
example, a window was closed in mouse press handler, then will not
get a mouse release.
Fixes: QTBUG-100942
Change-Id: I637a6744909ddbe62bdeba6b21494e5a6ae7fa9f
Reviewed-by: Tang Haixiang <tanghaixiang@uniontech.com>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 409d1080f25b653b3ff3f57c9776c5c390912206)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 4c32a534..42a0693a 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -736,6 +736,11 @@ public: void QWaylandInputDevice::Pointer::pointer_leave(uint32_t time, struct wl_surface *surface) { + invalidateFocus(); + mButtons = Qt::NoButton; + + mParent->mTime = time; + // The event may arrive after destroying the window, indicated by // a null surface. if (!surface) @@ -747,11 +752,6 @@ void QWaylandInputDevice::Pointer::pointer_leave(uint32_t time, struct wl_surfac if (!QWaylandWindow::mouseGrab()) setFrameEvent(new LeaveEvent(window, mSurfacePos, mGlobalPos)); - - invalidateFocus(); - mButtons = Qt::NoButton; - - mParent->mTime = time; } class MotionEvent : public QWaylandPointerEvent |