summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-04-27 18:04:37 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2021-04-28 21:35:51 +0200
commit3b9064ae568d55d2dd8d31f11b481396f49c4ce1 (patch)
treeae375269a548b514ed67a2d2f41eb4579c81df14
parent6e07df8aeeeca19f392220dddb9a3b62608032c9 (diff)
QQuickDeliveryAgent::event(): handle tablet events explicitly
QQuickWindow::event() forwards all input events to the DA. If it's not handled there, it eventually gets handled at the bottom by forwarding to QWindow::event() which then dispatches to QQuickWindow::tabletEvent() and from there to da->deliverPointerEvent(); however the switch in QWindow::event() is not meant to be the normal entry point for input events anymore. In a subsequent patch we will move the failsafe "never allow any kind of grab to persist after release" into QQuickWindow::event(), before that is reached; that in turn breaks tst_PointHandler::tabletStylus(), showing that the point is ungrabbed on release before PointHandler handles it and has a chance to emit pointChanged. So we must handle tablet events earlier, alongside mouse and touch events. Amends 68c103225f4e8bd6c1b18ef547108fd60f398c0f. Change-Id: Id7508e4bbbdbfe88d002d298c15ec727040f02ef Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 73148c79a328cb834a51de5c152f32851194ce52)
-rw-r--r--src/quick/util/qquickdeliveryagent.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick/util/qquickdeliveryagent.cpp b/src/quick/util/qquickdeliveryagent.cpp
index 332b6a8537..673bc1a009 100644
--- a/src/quick/util/qquickdeliveryagent.cpp
+++ b/src/quick/util/qquickdeliveryagent.cpp
@@ -794,6 +794,13 @@ bool QQuickDeliveryAgent::event(QEvent *ev)
d->lastWheelEventAccepted = event->isAccepted();
break;
}
+#if QT_CONFIG(tabletevent)
+ case QEvent::TabletPress:
+ case QEvent::TabletMove:
+ case QEvent::TabletRelease:
+ d->deliverPointerEvent(static_cast<QPointerEvent *>(ev));
+ break;
+#endif
default:
return false;
}