summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSanthosh Kumar <santhosh.kumar.selvaraj@qt.io>2023-06-09 13:17:01 +0200
committerSanthosh Kumar <santhosh.kumar.selvaraj@qt.io>2023-06-29 22:14:47 +0200
commit3902fb0438d946a466b67f2b82ba8779c731e55d (patch)
treed73dc832f76959321c33863001bc6074f90965b3 /src
parent1f70c073d4325bc0eb9b0cec5156c3b89ce1b4df (diff)
Fix button state validation in windows platform during drag and drop
The button state from windows when we use GetAsynckeyState() provides both MK_LBUTTON and MK_RIGHTBUTTON at the same time. This creates an issue when we validate only with single state to determine DRAGDROP_S_DROP operation. Normally, The MK_RBUTTON will be delivered when we have long press during drag. But sometimes (no definitive reason identified) the key state from windows contains both the key state (MK_LBUTTON | Mk_RBUTTON) during drag and drop operation with touch. This patch set fixes the issue by validating all key state instead of a particular state. Fixes: QTBUG-112995 Pick-to: 6.6 6.5 Change-Id: I67bf5f4956b68279ecc5fbeca8e8e7aef46d0482 Reviewed-by: Timothée Keller <timothee.keller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp
index 48e0bba41f..b797217c6f 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.cpp
+++ b/src/plugins/platforms/windows/qwindowsdrag.cpp
@@ -348,7 +348,7 @@ QWindowsOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
} else {
if (buttons && !m_currentButtons) {
m_currentButtons = buttons;
- } else if (!(m_currentButtons & buttons)) { // Button changed: Complete Drop operation.
+ } else if (m_currentButtons != buttons) { // Button changed: Complete Drop operation.
result = DRAGDROP_S_DROP;
}
}