Title: [144915] trunk/Tools
- Revision
- 144915
- Author
- abe...@webkit.org
- Date
- 2013-03-06 06:06:40 -0800 (Wed, 06 Mar 2013)
Log Message
[Qt][MiniBrowser] Touch mocking broken for chained getures
https://bugs.webkit.org/show_bug.cgi?id=111430
Reviewed by Jocelyn Turcotte.
Make it possible again to use touch mocking to test gesture chains
like pan->pinch->pan->pinch without lifting the primary "finger".
For this to work we need to track the pressed mouse buttons and
only synthesize touch release events when the ctrl key is released
if no mouse button is pressed. Else the pressed mouse button(s)
should result in a stationary touch point in a touch update event.
Since it has been fixed in Qt 5.0.1 use QGuiApplication::keyboardModifiers()
to check for the state of the ctrl key modifier instead of getting
it from the mouse events.
* MiniBrowser/qt/MiniBrowserApplication.cpp:
(MiniBrowserApplication::MiniBrowserApplication):
(MiniBrowserApplication::notify):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (144914 => 144915)
--- trunk/Tools/ChangeLog 2013-03-06 14:02:38 UTC (rev 144914)
+++ trunk/Tools/ChangeLog 2013-03-06 14:06:40 UTC (rev 144915)
@@ -1,3 +1,24 @@
+2013-03-06 Andras Becsi <andras.be...@digia.com>
+
+ [Qt][MiniBrowser] Touch mocking broken for chained getures
+ https://bugs.webkit.org/show_bug.cgi?id=111430
+
+ Reviewed by Jocelyn Turcotte.
+
+ Make it possible again to use touch mocking to test gesture chains
+ like pan->pinch->pan->pinch without lifting the primary "finger".
+ For this to work we need to track the pressed mouse buttons and
+ only synthesize touch release events when the ctrl key is released
+ if no mouse button is pressed. Else the pressed mouse button(s)
+ should result in a stationary touch point in a touch update event.
+ Since it has been fixed in Qt 5.0.1 use QGuiApplication::keyboardModifiers()
+ to check for the state of the ctrl key modifier instead of getting
+ it from the mouse events.
+
+ * MiniBrowser/qt/MiniBrowserApplication.cpp:
+ (MiniBrowserApplication::MiniBrowserApplication):
+ (MiniBrowserApplication::notify):
+
2013-03-05 Dirk Pranke <dpra...@chromium.org>
[chromium] don't use custom freetype on linux asan for now
Modified: trunk/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp (144914 => 144915)
--- trunk/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp 2013-03-06 14:02:38 UTC (rev 144914)
+++ trunk/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp 2013-03-06 14:06:40 UTC (rev 144915)
@@ -110,6 +110,8 @@
if (!browserWindow)
return QGuiApplication::notify(target, event);
+ m_holdingControl = QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
+
// In QML events are propagated through parents. But since the WebView
// may consume key events, a shortcut might never reach the top QQuickItem.
// Therefore we are checking here for shortcuts.
@@ -131,15 +133,17 @@
if (event->type() == QEvent::KeyRelease && static_cast<QKeyEvent*>(event)->key() == Qt::Key_Control) {
foreach (int id, m_heldTouchPoints)
- if (m_touchPoints.contains(id))
+ if (m_touchPoints.contains(id) && !QGuiApplication::mouseButtons().testFlag(Qt::MouseButton(id))) {
m_touchPoints[id].setState(Qt::TouchPointReleased);
- m_heldTouchPoints.clear();
- sendTouchEvent(browserWindow, QEvent::TouchEnd, static_cast<QKeyEvent*>(event)->timestamp());
+ m_heldTouchPoints.remove(id);
+ } else
+ m_touchPoints[id].setState(Qt::TouchPointStationary);
+
+ sendTouchEvent(browserWindow, m_heldTouchPoints.isEmpty() ? QEvent::TouchEnd : QEvent::TouchUpdate, static_cast<QKeyEvent*>(event)->timestamp());
}
if (isMouseEvent(event)) {
const QMouseEvent* const mouseEvent = static_cast<QMouseEvent*>(event);
- m_holdingControl = mouseEvent->modifiers().testFlag(Qt::ControlModifier);
QTouchEvent::TouchPoint touchPoint;
touchPoint.setPressure(1);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes