Title: [124462] trunk/Source/WebKit2
- Revision
- 124462
- Author
- [email protected]
- Date
- 2012-08-02 09:07:01 -0700 (Thu, 02 Aug 2012)
Log Message
[Qt] Fix axis locking when panning on N9
https://bugs.webkit.org/show_bug.cgi?id=92394
Patch by Lauro Neto <[email protected]> on 2012-08-02
Reviewed by Simon Hausmann.
Make the QQuickWebView axis locker calculate the
time between events using QInputEvent.timestamp, which
is set from the native event when available.
Also use touchPoint.pos() instead of screenPos() to
correct the axis detection when running on N9, which
has a native landscape display and the applications usually
run in portrait mode.
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::FlickableAxisLocker::FlickableAxisLocker):
(QQuickWebViewPrivate::FlickableAxisLocker::touchVelocity):
(QQuickWebViewPrivate::FlickableAxisLocker::update):
* UIProcess/API/qt/qquickwebview_p_p.h:
(FlickableAxisLocker):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (124461 => 124462)
--- trunk/Source/WebKit2/ChangeLog 2012-08-02 16:03:46 UTC (rev 124461)
+++ trunk/Source/WebKit2/ChangeLog 2012-08-02 16:07:01 UTC (rev 124462)
@@ -1,3 +1,26 @@
+2012-08-02 Lauro Neto <[email protected]>
+
+ [Qt] Fix axis locking when panning on N9
+ https://bugs.webkit.org/show_bug.cgi?id=92394
+
+ Reviewed by Simon Hausmann.
+
+ Make the QQuickWebView axis locker calculate the
+ time between events using QInputEvent.timestamp, which
+ is set from the native event when available.
+
+ Also use touchPoint.pos() instead of screenPos() to
+ correct the axis detection when running on N9, which
+ has a native landscape display and the applications usually
+ run in portrait mode.
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewPrivate::FlickableAxisLocker::FlickableAxisLocker):
+ (QQuickWebViewPrivate::FlickableAxisLocker::touchVelocity):
+ (QQuickWebViewPrivate::FlickableAxisLocker::update):
+ * UIProcess/API/qt/qquickwebview_p_p.h:
+ (FlickableAxisLocker):
+
2012-08-02 Hyerim Bae <[email protected]>
[EFL][WK2]Add ewk_view_ui_client.
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp (124461 => 124462)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2012-08-02 16:03:46 UTC (rev 124461)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2012-08-02 16:07:01 UTC (rev 124462)
@@ -185,7 +185,7 @@
QQuickWebViewPrivate::FlickableAxisLocker::FlickableAxisLocker()
: m_allowedDirection(QQuickFlickable::AutoFlickDirection)
- , m_sampleCount(0)
+ , m_time(0), m_sampleCount(0)
{
}
@@ -197,8 +197,8 @@
if (touchVelocityAvailable)
return touchPoint.velocity();
- const QLineF movementLine(touchPoint.screenPos(), m_initialScreenPosition);
- const qint64 elapsed = m_time.elapsed();
+ const QLineF movementLine(touchPoint.pos(), m_initialPosition);
+ const ulong elapsed = event->timestamp() - m_time;
if (!elapsed)
return QVector2D(0, 0);
@@ -215,8 +215,8 @@
++m_sampleCount;
if (m_sampleCount == 1) {
- m_initialScreenPosition = touchPoint.screenPos();
- m_time.restart();
+ m_initialPosition = touchPoint.pos();
+ m_time = event->timestamp();
return;
}
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h (124461 => 124462)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h 2012-08-02 16:03:46 UTC (rev 124461)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h 2012-08-02 16:07:01 UTC (rev 124462)
@@ -143,8 +143,8 @@
class FlickableAxisLocker {
QQuickFlickable::FlickableDirection m_allowedDirection;
- QElapsedTimer m_time;
- QPointF m_initialScreenPosition;
+ ulong m_time;
+ QPointF m_initialPosition;
QPointF m_lockReferencePosition;
int m_sampleCount;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes