diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-10-11 16:43:42 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-10-14 01:57:43 +0000 |
commit | d8c72f41548a01bf39f82e77da01a2be57a06d95 (patch) | |
tree | 4410ae85bd2ecfd718d9988229abdcc526639d2e /src/gui/kernel/qwindowsysteminterface.h | |
parent | 815341dbec1fd4f04fe76fc438cc9b3308ffafe9 (diff) |
iOS: Take advantage of new synchronous API for QPA event delivery
By using the SynchronousDelivery specialization instead of flushing all
window system events, we remove the risk of flushing an event that was
added without our knowledge.
For example, QGuiApplicationPrivate::processMouseEvent() used to prepend
a mouse move event to the QPA queue, which is why we had a check for
QWidgetWindow when flushing geometry changes. processMouseEvent no longer
sends the move event via the QPA queue, so that's no longer an issue,
but if it were to be reintroduced, we wouldn't need to check for
QWidgetWindow, as we're not flushing all events anymore.
Change-Id: Ib346ea9501cd88ddda6c2137981d3eb0922192a0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface.h')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index 6fade3cc4c..3be3c3188c 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -150,11 +150,19 @@ public: template<typename Delivery = QWindowSystemInterface::DefaultDelivery> static void handleTouchEvent(QWindow *w, ulong timestamp, QTouchDevice *device, const QList<struct TouchPoint> &points, Qt::KeyboardModifiers mods = Qt::NoModifier); + template<typename Delivery = QWindowSystemInterface::DefaultDelivery> static void handleTouchCancelEvent(QWindow *w, QTouchDevice *device, Qt::KeyboardModifiers mods = Qt::NoModifier); + template<typename Delivery = QWindowSystemInterface::DefaultDelivery> static void handleTouchCancelEvent(QWindow *w, ulong timestamp, QTouchDevice *device, Qt::KeyboardModifiers mods = Qt::NoModifier); // rect is relative to parent + template<typename Delivery = QWindowSystemInterface::DefaultDelivery> static void handleGeometryChange(QWindow *w, const QRect &newRect, const QRect &oldRect = QRect()); + + // region is in local coordinates, do not confuse with geometry which is parent-relative + template<typename Delivery = QWindowSystemInterface::DefaultDelivery> + static void handleExposeEvent(QWindow *tlw, const QRegion ®ion); + static void handleCloseEvent(QWindow *w, bool *accepted = Q_NULLPTR); template<typename Delivery = QWindowSystemInterface::DefaultDelivery> @@ -162,6 +170,7 @@ public: template<typename Delivery = QWindowSystemInterface::DefaultDelivery> static void handleLeaveEvent(QWindow *w); static void handleEnterLeaveEvent(QWindow *enter, QWindow *leave, const QPointF &local = QPointF(), const QPointF& global = QPointF()); + template<typename Delivery = QWindowSystemInterface::DefaultDelivery> static void handleWindowActivated(QWindow *w, Qt::FocusReason r = Qt::OtherFocusReason); static void handleWindowStateChanged(QWindow *w, Qt::WindowState newState); @@ -169,9 +178,6 @@ public: static void handleApplicationStateChanged(Qt::ApplicationState newState, bool forcePropagate = false); - // region is in local coordinates, do not confuse with geometry which is parent-relative - static void handleExposeEvent(QWindow *tlw, const QRegion ®ion); - #ifndef QT_NO_DRAGANDDROP // Drag and drop. These events are sent immediately. static QPlatformDragQtResponse handleDrag(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions); |