Bug 746679 - Reset touch event dispatch state on each touch down. r=kats, a=blocking-fennec
authorWes Johnston <wjohnston@mozilla.com>
Fri, 20 Apr 2012 08:40:41 -0700
changeset 95352 f5fdf571dbd6defd92dec7e09df3fdf1f2d565dd
parent 95351 a1c77b5ee099b64128227741454f32af37279865
child 95353 27a52fed91a5216c7970b1ac78d6234e7727b53a
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, blocking-fennec
bugs746679
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 746679 - Reset touch event dispatch state on each touch down. r=kats, a=blocking-fennec
mobile/android/base/gfx/TouchEventHandler.java
--- a/mobile/android/base/gfx/TouchEventHandler.java
+++ b/mobile/android/base/gfx/TouchEventHandler.java
@@ -140,16 +140,21 @@ public final class TouchEventHandler imp
         if (mOnTouchListener == null) {
             dispatchEvent(event);
             return true;
         }
 
         if (isDownEvent(event)) {
             // this is the start of a new block of events! whee!
             mHoldInQueue = mWaitForTouchListeners;
+
+            // Set mDispatchEvents to true so that we are guaranteed to either queue these
+            // events or dispatch them. The only time we should not do either is once we've
+            // heard back from content to preventDefault this block.
+            mDispatchEvents = true;
             if (mHoldInQueue) {
                 // if we're holding the events in the queue, set the timeout so that
                 // we dispatch these events if we don't get a default-prevented notification
                 mView.postDelayed(mListenerTimeoutProcessor, EVENT_LISTENER_TIMEOUT);
             } else {
                 // if we're not holding these events, then we still need to pretend like
                 // we did and had a ListenerTimeoutProcessor fire so that when we get
                 // the default-prevented notification for this block, it doesn't accidentally