From efcfa0b252a96a7064dcd9b1767ff61e7875bab5 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 11 Mar 2014 22:10:05 +0100 Subject: QGuiApplication: send TouchCancel when touch is interrupted by popup QQuickWindow depends on maintaining state of known touch points between events, so it needs to be notified when it will not be receiving the corresponding release event for one or more. This temporary fix needs to be reverted when we have a proper event forwarding solution. Task-number: QTBUG-37371 Change-Id: I5dc40af6feac425be8103c1586f8ebe3a6aad20d Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qguiapplication.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index c6376b2647..a19eebfb7c 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2294,6 +2294,18 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To if (w->d_func()->blockedByModalWindow) { // a modal window is blocking this window, don't allow touch events through + + // QTBUG-37371 temporary fix; TODO: revisit in 5.4 when we have a forwarding solution + if (eventType == QEvent::TouchEnd) { + // but don't leave dangling state: e.g. + // QQuickWindowPrivate::itemForTouchPointId needs to be cleared. + QTouchEvent touchEvent(QEvent::TouchCancel, + e->device, + e->modifiers); + touchEvent.setTimestamp(e->timestamp); + touchEvent.setWindow(w); + QGuiApplication::sendSpontaneousEvent(w, &touchEvent); + } continue; } -- cgit v1.2.3