Skip to content

Instantly share code, notes, and snippets.

@kenchris
Created March 7, 2012 13:13
Show Gist options
  • Save kenchris/1993037 to your computer and use it in GitHub Desktop.
Save kenchris/1993037 to your computer and use it in GitHub Desktop.
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index 299ac1c..130ab9b 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -1007,7 +1007,10 @@ void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event)
if (!isValid())
return;
- if (m_needTouchEvents) {
+ // If the page is suspended, which should be the case during panning, pinching
+ // and animation on the page itself (kinetic scrolling, tap to zoom) etc, then
+ // we do not send any of the events to the page event if is has listeners.
+ if (m_needTouchEvents && !m_isPageSuspended) {
m_touchEventQueue.append(event);
process()->responsivenessTimer()->start();
if (m_shouldSendEventsSynchronously) {
diff --git a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
index 334b637..c838767 100644
--- a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
@@ -509,7 +509,7 @@ void QtViewportInteractionEngine::pinchGestureStarted(const QPointF& pinchCenter
m_hadUserInteraction = true;
- m_scaleUpdateDeferrer = adoptPtr(new ViewportUpdateDeferrer(this));
+ m_scaleUpdateDeferrer = adoptPtr(new ViewportUpdateDeferrer(this, ViewportUpdateDeferrer::DeferUpdateAndSuspendContent));
m_lastPinchCenterInViewportCoordinates = pinchCenterInViewportCoordinates;
m_pinchStartScale = m_content->contentsScale();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment