Bug 1043689 - Cancel state in the GEL when processing a cancelled touch block. r=botond

This commit is contained in:
Kartikaya Gupta 2014-07-31 14:21:49 -04:00
Родитель 3b75e664d7
Коммит a1aac133a1
2 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -2627,6 +2627,12 @@ AsyncPanZoomController::ProcessPendingInputBlocks() {
if (curBlock->IsDefaultPrevented()) {
SetState(NOTHING);
curBlock->DropEvents();
// Also clear the state in the gesture event listener
nsRefPtr<GestureEventListener> listener = GetGestureEventListener();
if (listener) {
MultiTouchInput cancel(MultiTouchInput::MULTITOUCH_CANCEL, 0, TimeStamp::Now(), 0);
listener->HandleInputEvent(cancel);
}
} else {
while (curBlock->HasEvents()) {
HandleInputEvent(curBlock->RemoveFirstEvent());

Просмотреть файл

@ -388,6 +388,8 @@ nsEventStatus GestureEventListener::HandleInputTouchCancel()
void GestureEventListener::HandleInputTimeoutLongTap()
{
GEL_LOG("Running long-tap timeout task in state %d\n", mState);
mLongTapTimeoutTask = nullptr;
switch (mState) {
@ -414,6 +416,8 @@ void GestureEventListener::HandleInputTimeoutLongTap()
void GestureEventListener::HandleInputTimeoutMaxTap()
{
GEL_LOG("Running max-tap timeout task in state %d\n", mState);
mMaxTapTimeoutTask = nullptr;
if (mState == GESTURE_FIRST_SINGLE_TOUCH_DOWN) {