Changeset 109415 in webkit
- Timestamp:
- Mar 1, 2012, 1:51:26 PM (15 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/qt/QtFlickProvider.cpp (modified) (2 diffs)
-
UIProcess/qt/QtPanGestureRecognizer.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r109405 r109415 1 2012-03-01 Andras Becsi <andras.becsi@nokia.com> 2 3 [Qt][WK2] Make the interaction with the Flickable work on the N9 4 https://bugs.webkit.org/show_bug.cgi?id=80029 5 6 Reviewed by Simon Hausmann. 7 8 Because the WebView item accepts all touch events it receives and sends 9 them to the web process before propagating them to the gesture recognizers, 10 which is correct behaviour, we can not rely on the touch->mouse conversion 11 of Qt5 when controlling Flickable. Hence we need to convert the received 12 touch events to mouse events in the QtFlickProvider. 13 14 * UIProcess/qt/QtFlickProvider.cpp: 15 (QtFlickProvider::handleTouchFlickEvent): 16 Do the touch to mouse event conversion for the Flickable. 17 * UIProcess/qt/QtPanGestureRecognizer.cpp: 18 (WebKit::QtPanGestureRecognizer::recognize): 19 A touch begin event should cancel the previous pan gesture 20 and stop the ongoing flick animation. 21 1 22 2012-03-01 Anders Carlsson <andersca@apple.com> 2 23 -
trunk/Source/WebKit2/UIProcess/qt/QtFlickProvider.cpp
r109094 r109415 27 27 #include <QCoreApplication> 28 28 #include <QDeclarativeEngine> 29 #include <QMouseEvent> 29 30 #include <QPointF> 31 #include <QQuickCanvas> 30 32 #include <QQuickItem> 31 33 #include <QTouchEvent> … … 117 119 } 118 120 119 void QtFlickProvider::handleTouchFlickEvent(QTouchEvent* event) 120 { 121 QCoreApplication::sendEvent(m_flickable, event); 121 void QtFlickProvider::handleTouchFlickEvent(QTouchEvent* touchEvent) 122 { 123 // Since the Flickable does not handle touch events directly the sent 124 // touch event would end up in the WebView again and would thus trigger 125 // an infinite loop. 126 // Hence do the touch to mouse event conversion for the Flickable here. 127 QEvent::Type mouseEventType = QEvent::None; 128 Qt::MouseButton mouseButton = Qt::NoButton; 129 130 switch (touchEvent->type()) { 131 case QEvent::TouchBegin: 132 mouseEventType = QEvent::MouseButtonPress; 133 134 // We need to set the mouse button so that the Flickable 135 // item receives the initial mouse press event. 136 mouseButton = Qt::LeftButton; 137 break; 138 case QEvent::TouchUpdate: 139 mouseEventType = QEvent::MouseMove; 140 break; 141 case QEvent::TouchEnd: 142 mouseEventType = QEvent::MouseButtonRelease; 143 break; 144 default: 145 ASSERT_NOT_REACHED(); 146 break; 147 } 148 149 QPointF touchPosition = touchEvent->touchPoints().last().pos(); 150 QMouseEvent mouseEvent(mouseEventType, touchPosition, mouseButton, mouseButton, Qt::NoModifier); 151 152 // Send the event to the canvas and let the canvas propagate it 153 // to the Flickable. This makes sure that the Flickable grabs 154 // the mouse so that it also receives the events of gestures 155 // which started inside the viewport but ended outside of it. 156 QCoreApplication::sendEvent(m_flickable->canvas(), &mouseEvent); 122 157 } 123 158 -
trunk/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp
r107232 r109415 64 64 m_firstPosition = touchPoint.screenPos(); 65 65 m_touchBegin.reset(new QTouchEvent(*event)); 66 interactionEngine()->panGestureCancelled(); 66 67 return false; 67 68 case QEvent::TouchUpdate: {
Note:
See TracChangeset
for help on using the changeset viewer.