Bug 342885: Session restore launches even when I haven't crashed, patch by Simon B�nzli <zeniko@gmail.com>, r=me, sr=neil

This commit is contained in:
gavin%gavinsharp.com 2007-01-04 18:00:32 +00:00
Родитель ec6531da50
Коммит 0aca25376c
2 изменённых файлов: 12 добавлений и 0 удалений

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

@ -96,6 +96,7 @@ const DEFAULT_RESUME_FROM_CRASH = true;
const OBSERVING = [
"domwindowopened", "domwindowclosed",
"quit-application-requested", "quit-application-granted",
"quit-application-roughly", // XXXzeniko work-around for bug 333907
"quit-application", "browser:purge-session-history"
];
@ -295,6 +296,7 @@ SessionStoreService.prototype = {
this._loadState = STATE_QUITTING;
break;
case "quit-application":
case "quit-application-roughly":
if (aData == "restart")
this._prefBranch.setBoolPref("sessionstore.resume_session_once", true);
this._loadState = STATE_QUITTING; // just to be sure

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

@ -5262,6 +5262,16 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
break;
#endif
case WM_ENDSESSION:
// XXXzeniko allow components to deal with a rough shutdown as long as there's no
// clean fix for bug 333907
if (wParam) {
nsCOMPtr<nsIObserverService> observerService
= do_GetService("@mozilla.org/observer-service;1");
if (observerService)
observerService->NotifyObservers(nsnull, "quit-application-roughly", nsnull);
}
break;
#ifdef WINCE
case WM_HIBERNATE: