mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 14:45:29 +00:00
Bug 1073502 - Restore closed windows even when there are no open windows on startup r=yoric
This commit is contained in:
parent
c6d1a998a4
commit
5a90497000
@ -2202,12 +2202,9 @@ let SessionStoreInternal = {
|
||||
if (aWindow && (!aWindow.__SSi || !this._windows[aWindow.__SSi]))
|
||||
this.onLoad(aWindow);
|
||||
|
||||
let root;
|
||||
try {
|
||||
var root = typeof aState == "string" ? JSON.parse(aState) : aState;
|
||||
if (!root.windows[0]) {
|
||||
this._sendRestoreCompletedNotifications();
|
||||
return; // nothing to restore
|
||||
}
|
||||
root = (typeof aState == "string") ? JSON.parse(aState) : aState;
|
||||
}
|
||||
catch (ex) { // invalid state object - don't restore anything
|
||||
debug(ex);
|
||||
@ -2215,15 +2212,23 @@ let SessionStoreInternal = {
|
||||
return;
|
||||
}
|
||||
|
||||
// Restore closed windows if any.
|
||||
if (root._closedWindows) {
|
||||
this._closedWindows = root._closedWindows;
|
||||
}
|
||||
|
||||
// We're done here if there are no windows.
|
||||
if (!root.windows || !root.windows.length) {
|
||||
this._sendRestoreCompletedNotifications();
|
||||
return;
|
||||
}
|
||||
|
||||
TelemetryStopwatch.start("FX_SESSION_RESTORE_RESTORE_WINDOW_MS");
|
||||
|
||||
// We're not returning from this before we end up calling restoreTabs
|
||||
// for this window, so make sure we send the SSWindowStateBusy event.
|
||||
this._setWindowStateBusy(aWindow);
|
||||
|
||||
if (root._closedWindows)
|
||||
this._closedWindows = root._closedWindows;
|
||||
|
||||
var winData;
|
||||
if (!root.selectedWindow || root.selectedWindow > root.windows.length) {
|
||||
root.selectedWindow = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user