Bug 179056 "Check for new message every" stops after hibernate. patch by Masatoshi Kimura (emk) <VYV03354@nifty.ne.jp> r=emaijala+sfraser, sr=roc

This commit is contained in:
masayuki%d-toybox.com 2006-02-23 17:02:45 +00:00
Родитель a39794becf
Коммит cbae11fb11
3 изменённых файлов: 35 добавлений и 0 удалений

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

@ -71,6 +71,7 @@
#include "nsRect.h"
#include "nsTransform2D.h"
#include "nsIEventQueue.h"
#include "nsIObserverService.h"
#include "imgIContainer.h"
#include "gfxIImageFrame.h"
#include "nsNativeCharsetUtils.h"
@ -3996,6 +3997,17 @@ void nsWindow::DispatchPendingEvents()
}
}
#ifndef WINCE
void nsWindow::PostSleepWakeNotification(const char* aNotification)
{
nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1");
if (observerService)
{
observerService->NotifyObservers(nsnull, aNotification, nsnull);
}
}
#endif
PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *aRetValue)
{
static UINT vkKeyCached = 0; // caches VK code fon WM_KEYDOWN
@ -4115,6 +4127,26 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
}
break;
#ifndef WINCE
case WM_POWERBROADCAST:
// only hidden window handle this
// to prevent duplicate notification
if (mWindowType == eWindowType_invisible) {
switch (wParam)
{
case PBT_APMSUSPEND:
PostSleepWakeNotification("sleep_notification");
break;
case PBT_APMRESUMEAUTOMATIC:
case PBT_APMRESUMECRITICAL:
case PBT_APMRESUMESUSPEND:
PostSleepWakeNotification("wake_notification");
break;
}
}
break;
#endif
case WM_MOVE: // Window moved
{
PRInt32 x = GET_X_LPARAM(lParam); // horizontal position in screen coordinates

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

@ -267,6 +267,8 @@ protected:
static void RegisterSpecialDropdownHooks();
static void UnregisterSpecialDropdownHooks();
static void PostSleepWakeNotification(const char* aNotification);
#endif
static BOOL DealWithPopups (HWND inWnd, UINT inMsg, WPARAM inWParam, LPARAM inLParam, LRESULT* outResult);

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

@ -428,6 +428,7 @@ void TimerThread::DoBeforeSleep()
void TimerThread::DoAfterSleep()
{
mSleeping = PR_TRUE; // wake may be notified without preceding sleep notification
for (PRInt32 i = 0; i < mTimers.Count(); i ++) {
nsTimerImpl *timer = NS_STATIC_CAST(nsTimerImpl*, mTimers[i]);
// get and set the delay to cause its timeout to be recomputed