bug 727847 - meter orientation events on android r=dougt

This commit is contained in:
Brad Lassey 2012-02-16 23:03:57 -08:00
parent 585ae3af5b
commit 6a55170fc3
2 changed files with 8 additions and 1 deletions

View File

@ -95,7 +95,8 @@ nsAppShell::nsAppShell()
mCondLock("nsAppShell.mCondLock"),
mQueueCond(mCondLock, "nsAppShell.mQueueCond"),
mNumDraws(0),
mNumViewports(0)
mNumViewports(0),
mPendingOrientationEvents(false)
{
gAppShell = this;
}
@ -342,6 +343,7 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
-curEvent->Alpha(),
curEvent->Beta(),
curEvent->Gamma());
mPendingOrientationEvents = false;
break;
case AndroidGeckoEvent::LOCATION_EVENT: {
@ -589,6 +591,10 @@ nsAppShell::PostEvent(AndroidGeckoEvent *ae)
delete event;
}
}
} else if (ae->Type() == AndroidGeckoEvent::ORIENTATION_EVENT) {
if (!mPendingOrientationEvents)
mEventQueue.AppendElement(ae);
mPendingOrientationEvents = true;
} else {
mEventQueue.AppendElement(ae);
}

View File

@ -110,6 +110,7 @@ protected:
mozilla::AndroidGeckoEvent *PeekNextEvent();
nsCOMPtr<nsIAndroidBrowserApp> mBrowserApp;
bool mPendingOrientationEvents;
};
#endif // nsAppShell_h__