Bug 1383365 - Add in missing code for mActiveKeyboardBlock in InputQueue. r?kats draft
authorRyan Hunt <rhunt@eqrion.net>
Wed, 26 Jul 2017 20:31:40 -0400
changeset 616855 3d684c76e67c3cbc2434e41f343232d6e6a69366
parent 616527 6824ddf0e0d00134b49147fee21ee4e75455ff29
child 639614 386625e8edfb41ac78700a505d9c0cce8d691aac
push id70832
push userbmo:rhunt@eqrion.net
push dateThu, 27 Jul 2017 15:19:44 +0000
reviewerskats
bugs1383365
milestone56.0a1
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