From a4618c020d3923eb6c8c55115c49d7c9f00b3034 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Mon, 17 May 2021 00:54:51 +0200 Subject: [PATCH] Windows QPA: Fix dock widget drag&drop failure A previous change to fix QTBUG-85431 has caused this issue by emulating the behavior of the non-enhanced mouse event handler in a particular case, where mouse move events that did not change position were ignored. However, some of these events seem to be involved in the dock drag&drop implementation. This issue is also reproduced in pre-5.15 releases, predating the QTBUG-85431 fix, by disabling the enhanced mouse event handler by setting the QT_QPA_DISABLE_ENHANCED_MOUSE env var. However, the ignored events in the current issue seem to be non-client events only, while the QTBUG-85431 issue was related to client mouse events. So we can restrict the test added in the QTBUG-85431 fix and have both issues fixed. Fixes: QTBUG-92182 Change-Id: I98c0c8597912c7f4fe58af375a5a560695a82746 Reviewed-by: Friedemann Kleint (cherry picked from commit 92198efbd2c696470711e7f24c5b6507bb664ce9) Reviewed-by: Qt Cherry-pick Bot --- src/gui/kernel/qguiapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 08a00d82276..5bf0bc25c90 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2187,7 +2187,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo processMouseEvent(e); // the original mouse event return; } - if (mouseMove && !positionChanged) { + if (type == QEvent::MouseMove && !positionChanged) { // On Windows, and possibly other platforms, a touchpad can send a mouse move // that does not change position, between a press and a release. This may // confuse applications, so we always filter out these mouse events for