mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 757680 - Add a pref to turn off event coalescing. r=kats
This commit is contained in:
parent
648c7e9553
commit
be7b3c9a7c
@ -688,3 +688,6 @@ pref("reader.color_scheme", "light");
|
||||
|
||||
// Used to show a first-launch tip in reader
|
||||
pref("reader.has_used_toolbar", false);
|
||||
|
||||
// Coalesce touch events to prevent them from flooding the event queue
|
||||
pref("dom.event.touch.coalescing.enabled", true);
|
||||
|
@ -213,9 +213,11 @@ nsAppShell::NotifyNativeEvent()
|
||||
|
||||
#define PREFNAME_MATCH_OS "intl.locale.matchOS"
|
||||
#define PREFNAME_UA_LOCALE "general.useragent.locale"
|
||||
#define PREFNAME_COALESCE_TOUCHES "dom.event.touch.coalescing.enabled"
|
||||
static const char* kObservedPrefs[] = {
|
||||
PREFNAME_MATCH_OS,
|
||||
PREFNAME_UA_LOCALE,
|
||||
PREFNAME_COALESCE_TOUCHES,
|
||||
nullptr
|
||||
};
|
||||
|
||||
@ -262,6 +264,7 @@ nsAppShell::Init()
|
||||
}
|
||||
|
||||
bridge->SetSelectedLocale(locale);
|
||||
mAllowCoalescingTouches = Preferences::GetBool(PREFNAME_COALESCE_TOUCHES, true);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -278,6 +281,8 @@ nsAppShell::Observe(nsISupports* aSubject,
|
||||
} else if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) && aData && (
|
||||
nsDependentString(aData).Equals(
|
||||
NS_LITERAL_STRING(PREFNAME_UA_LOCALE)) ||
|
||||
nsDependentString(aData).Equals(
|
||||
NS_LITERAL_STRING(PREFNAME_COALESCE_TOUCHES)) ||
|
||||
nsDependentString(aData).Equals(
|
||||
NS_LITERAL_STRING(PREFNAME_MATCH_OS)))) {
|
||||
AndroidBridge* bridge = AndroidBridge::Bridge();
|
||||
@ -301,6 +306,8 @@ nsAppShell::Observe(nsISupports* aSubject,
|
||||
}
|
||||
|
||||
bridge->SetSelectedLocale(locale);
|
||||
|
||||
mAllowCoalescingTouches = Preferences::GetBool(PREFNAME_COALESCE_TOUCHES, true);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_OK;
|
||||
@ -761,7 +768,7 @@ nsAppShell::PostEvent(AndroidGeckoEvent *ae)
|
||||
break;
|
||||
|
||||
case AndroidGeckoEvent::MOTION_EVENT:
|
||||
if (ae->Action() == AndroidMotionEvent::ACTION_MOVE) {
|
||||
if (ae->Action() == AndroidMotionEvent::ACTION_MOVE && mAllowCoalescingTouches) {
|
||||
int len = mEventQueue.Length();
|
||||
if (len > 0) {
|
||||
AndroidGeckoEvent* event = mEventQueue[len - 1];
|
||||
|
@ -70,6 +70,7 @@ protected:
|
||||
mozilla::AndroidGeckoEvent *mQueuedDrawEvent;
|
||||
mozilla::AndroidGeckoEvent *mQueuedViewportEvent;
|
||||
bool mAllowCoalescingNextDraw;
|
||||
bool mAllowCoalescingTouches;
|
||||
nsTArray<mozilla::AndroidGeckoEvent *> mEventQueue;
|
||||
nsInterfaceHashtable<nsStringHashKey, nsIObserver> mObserversHash;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user