mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 836872 - Use TimeStamp::NowLoRes() in nsAppShell, r=roc
This commit is contained in:
parent
c4a63c79fa
commit
ae8873afd8
@ -110,7 +110,7 @@ nsAppShell::Init()
|
||||
LSPAnnotate();
|
||||
#endif
|
||||
|
||||
mLastNativeEventScheduled = TimeStamp::Now();
|
||||
mLastNativeEventScheduled = TimeStamp::NowLoRes();
|
||||
|
||||
if (!sMsgId)
|
||||
sMsgId = RegisterWindowMessageW(kAppShellEventId);
|
||||
@ -205,7 +205,7 @@ nsAppShell::ScheduleNativeEventCallback()
|
||||
NS_ADDREF_THIS(); // will be released when the event is processed
|
||||
// Time stamp this event so we can detect cases where the event gets
|
||||
// dropping in sub classes / modal loops we do not control.
|
||||
mLastNativeEventScheduled = TimeStamp::Now();
|
||||
mLastNativeEventScheduled = TimeStamp::NowLoRes();
|
||||
::PostMessage(mEventWnd, sMsgId, 0, reinterpret_cast<LPARAM>(this));
|
||||
}
|
||||
|
||||
@ -251,8 +251,11 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
|
||||
|
||||
// Check for starved native callbacks. If we haven't processed one
|
||||
// of these events in NATIVE_EVENT_STARVATION_LIMIT, fire one off.
|
||||
if ((TimeStamp::Now() - mLastNativeEventScheduled) >
|
||||
NATIVE_EVENT_STARVATION_LIMIT) {
|
||||
static const mozilla::TimeDuration nativeEventStarvationLimit =
|
||||
mozilla::TimeDuration::FromSeconds(NATIVE_EVENT_STARVATION_LIMIT);
|
||||
|
||||
if ((TimeStamp::NowLoRes() - mLastNativeEventScheduled) >
|
||||
nativeEventStarvationLimit) {
|
||||
ScheduleNativeEventCallback();
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,9 @@
|
||||
#include <windows.h>
|
||||
#include "mozilla/TimeStamp.h"
|
||||
|
||||
// The maximum time we allow before forcing a native event callback
|
||||
#define NATIVE_EVENT_STARVATION_LIMIT mozilla::TimeDuration::FromSeconds(1)
|
||||
// The maximum time we allow before forcing a native event callback.
|
||||
// In seconds.
|
||||
#define NATIVE_EVENT_STARVATION_LIMIT 1
|
||||
|
||||
/**
|
||||
* Native Win32 Application shell wrapper
|
||||
|
Loading…
Reference in New Issue
Block a user