Bug 1383365 - Add in missing code for mActiveKeyboardBlock in InputQueue. r=kats
authorRyan Hunt <rhunt@eqrion.net>
Wed, 26 Jul 2017 20:31:40 -0400
changeset 420273 633262ca601a590faffcae53e98dd07aad22650f
parent 420272 c9d5da3bd0fa1fc3d5da478c8a4c9878114c4188
child 420274 bd10e5ba87d50cfc5aa47241358374b695e95779
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1383365
milestone56.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 1383365 - Add in missing code for mActiveKeyboardBlock in InputQueue. r=kats MozReview-Commit-ID: EUq8wPS1aDZ
gfx/layers/apz/src/InputQueue.cpp
--- a/gfx/layers/apz/src/InputQueue.cpp
+++ b/gfx/layers/apz/src/InputQueue.cpp
@@ -573,25 +573,27 @@ InputQueue::FindBlockForId(uint64_t aInp
     if (queuedInput->Block()->GetBlockId() == aInputBlockId) {
       if (aOutFirstInput) {
         *aOutFirstInput = queuedInput->Input();
       }
       return queuedInput->Block();
     }
   }
 
-  CancelableBlockState* block = nullptr;
+  InputBlockState* block = nullptr;
   if (mActiveTouchBlock && mActiveTouchBlock->GetBlockId() == aInputBlockId) {
     block = mActiveTouchBlock.get();
   } else if (mActiveWheelBlock && mActiveWheelBlock->GetBlockId() == aInputBlockId) {
     block = mActiveWheelBlock.get();
   } else if (mActiveDragBlock && mActiveDragBlock->GetBlockId() == aInputBlockId) {
     block = mActiveDragBlock.get();
   } else if (mActivePanGestureBlock && mActivePanGestureBlock->GetBlockId() == aInputBlockId) {
     block = mActivePanGestureBlock.get();
+  } else if (mActiveKeyboardBlock && mActiveKeyboardBlock->GetBlockId() == aInputBlockId) {
+    block = mActiveKeyboardBlock.get();
   }
   // Since we didn't encounter this block while iterating through mQueuedInputs,
   // it must have no events associated with it at the moment.
   if (aOutFirstInput) {
     *aOutFirstInput = nullptr;
   }
   return block;
 }
@@ -744,16 +746,19 @@ InputQueue::ProcessQueue() {
     mActiveWheelBlock = nullptr;
   }
   if (CanDiscardBlock(mActiveDragBlock)) {
     mActiveDragBlock = nullptr;
   }
   if (CanDiscardBlock(mActivePanGestureBlock)) {
     mActivePanGestureBlock = nullptr;
   }
+  if (CanDiscardBlock(mActiveKeyboardBlock)) {
+    mActiveKeyboardBlock = nullptr;
+  }
 }
 
 bool
 InputQueue::CanDiscardBlock(InputBlockState* aBlock)
 {
   if (!aBlock ||
       (aBlock->AsCancelableBlock() && !aBlock->AsCancelableBlock()->IsReadyForHandling()) ||
       aBlock->MustStayActive()) {
@@ -783,13 +788,14 @@ InputQueue::Clear()
 {
   APZThreadUtils::AssertOnControllerThread();
 
   mQueuedInputs.Clear();
   mActiveTouchBlock = nullptr;
   mActiveWheelBlock = nullptr;
   mActiveDragBlock = nullptr;
   mActivePanGestureBlock = nullptr;
+  mActiveKeyboardBlock = nullptr;
   mLastActiveApzc = nullptr;
 }
 
 } // namespace layers
 } // namespace mozilla