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 15:17:51 +0200 |
commit | fd2efc4913b51d4b61f04a254031dba851c4ed50 (patch) | |
tree | 96fed11863056360b687ee2a7a3880da8f49cab0 | |
parent | e1723cf288081b8205b070ee3cc96bbd0183110b (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.
Fixes: QTBUG-115757
Task-number: QTBUG-97037
Change-Id: I738769fde96f7da91f5bc4dc7a70ed49596dcd61
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 60647fa069ef4143642ae4c1b529ad2a7a7f2fd9)
-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 2829417d0..a2019e8c0 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; #if QT_CONFIG(cursor) wl_buffer *mCursorBuffer = nullptr; Qt::CursorShape mCursorShape = Qt::BitmapCursor; |