summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowspointerhandler.cpp
diff options
context:
space:
mode:
authorAndré de la Rocha <andre.rocha@qt.io>2022-10-13 20:10:13 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2022-10-28 10:27:11 +0000
commit31e7790102b260344893eaa8bf8b7b1a0f95e3b7 (patch)
tree962a127358b2b39f4ad4e7dc41a4b85b089bdedb /src/plugins/platforms/windows/qwindowspointerhandler.cpp
parent32774f13d961c138f82dc50c085c1d66d0a91dd1 (diff)
Windows QPA: Remove tablet->mouse synth and fix Drag&Drop with touch/pen
This patch avoids synthesizing mouse messages in the QPA for touch/pen input, and lets the GUI do mouse event synthesis for unhandled touch/pen events, if required, like in other platforms. This requires a workaround to avoid breaking drag and drop with touch/pen (or making it worse). DnD on Windows is based on the DoDragDrop() Win32 API, which does not work with touch/pen input, which in some cases cause a DnD operation started with touch/pen to hang until the mouse is moved. To avoid it we process pointer messages for touch/pen and generate mouse input through SendInput() to trigger DoDragDrop(), which then seems to work as expected. So now we inform QtGui that the Windows platform no longer sends synth-mouse events after tablet events (unsetting the flag added in f931e5e72d4617023bbea46cba2c0d61bb1efa4f); this completes what was attempted in 8ada0633cd58e0608df2e16880f1293286025504. Fixes: QTBUG-106368 Fixes: QTBUG-57577 Fixes: QTBUG-100788 Task-number: QTBUG-77414 Task-number: QTBUG-104594 Pick-to: 6.4 6.3 6.2 Change-Id: I46db3c74be2a95cf2d94ba930398e58dc930d2db Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowspointerhandler.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowspointerhandler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
index 89f236b8eef..88f02347b35 100644
--- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp
+++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
@@ -796,8 +796,8 @@ bool QWindowsPointerHandler::translateMouseEvent(QWindow *window,
break;
case QT_PT_PEN:
#if QT_CONFIG(tabletevent)
- if (!m_activeTabletDevice.isNull())
- device = m_activeTabletDevice.data();
+ qCDebug(lcQpaTablet) << "ignoring synth-mouse event for tablet event from" << device;
+ return false;
#endif
break;
}