diff options
author | Liang Qi <liang.qi@qt.io> | 2023-09-06 11:04:02 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2023-09-06 11:16:35 +0200 |
commit | 60647fa069ef4143642ae4c1b529ad2a7a7f2fd9 (patch) | |
tree | 6dde9865a2b95bf2b736af4f4f291408a21f914a /src/client | |
parent | 6d24c829f173c95e9f5860a2233bc916c356be01 (diff) |
Revert "Client: Send release button event on pointer leave"
This reverts commit 8235fa65fe033a94e7a44322d3502f25940092ec.
It makes tests/manual/examples/widgets/draganddrop/puzzle not work,
which does drag and drop in same app.
Pick-to: 6.6 6.5 6.2 5.15
Fixes: QTBUG-115757
Task-number: QTBUG-97037
Change-Id: I738769fde96f7da91f5bc4dc7a70ed49596dcd61
Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 9 | ||||
-rw-r--r-- | src/client/qwaylandinputdevice_p.h | 1 |
2 files changed, 2 insertions, 8 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 4eba3c589..dc59a2376 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -719,8 +719,8 @@ public: void QWaylandInputDevice::Pointer::pointer_leave(uint32_t time, struct wl_surface *surface) { - releaseButtons(); invalidateFocus(); + mButtons = Qt::NoButton; mParent->mTime = time; @@ -835,8 +835,6 @@ void QWaylandInputDevice::Pointer::pointer_button(uint32_t serial, uint32_t time default: return; // invalid button number (as far as Qt is concerned) } - mLastButton = qt_button; - if (state) mButtons |= qt_button; else @@ -875,13 +873,10 @@ 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()); + ReleaseEvent e(focusWindow(), mParent->mTime, mSurfacePos, mGlobalPos, mButtons, Qt::NoButton, mParent->modifiers()); window->handleMouse(mParent, e); } } diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index ea4b463c8..31ce50f68 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -336,7 +336,6 @@ public: QPointF mSurfacePos; QPointF mGlobalPos; Qt::MouseButtons mButtons = Qt::NoButton; - Qt::MouseButton mLastButton = Qt::NoButton; struct FrameData { QWaylandPointerEvent *event = nullptr; |