[Pkg-mozext-commits] [tabmixplus] 22/44: Force SessionStore.restoreLastSession to open new window only if the user restoe another session

David Prévot taffit at moszumanska.debian.org
Wed Oct 15 02:10:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit 042a722ccfa587e6af539d1e855a9107d50fc69f
Author: onemen <tabmix.onemen at gmail.com>
Date:   Fri Oct 10 20:53:32 2014 +0300

    Force SessionStore.restoreLastSession to open new window only if the user restoe another session
---
 chrome/content/session/session.js | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index a8c6781..f666686 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -326,7 +326,7 @@ var TabmixSessionManager = {
         obs.addObserver(this, "private-browsing-change-granted", true);
       }
       if (Tabmix.isVersion(270)) {
-        if (this.enableBackup && this.canRestoreLastSession)
+        if (!isFirstWindow && this.enableBackup && this.canRestoreLastSession)
           window.__SS_lastSessionWindowID = "" + Date.now() + Math.random();
         obs.addObserver(this, "sessionstore-last-session-cleared", true);
       }
@@ -2906,14 +2906,15 @@ try{
         TabmixSvc.ss.restoreLastSession();
    },
 
-   setLastSession: function(){
+   setLastSession: function(restoring) {
       let state = TabmixConvertSession.getSessionState(this.gSessionPath[1]);
       TabmixSvc.sm.lastSessionPath = this.gSessionPath[1];
       if (!Tabmix.isVersion(270))
          return state;
       // add __SS_lastSessionWindowID to force SessionStore.restoreLastSession
       // to open new window
-      window.__SS_lastSessionWindowID = "" + Date.now() + Math.random();
+      if (restoring)
+        window.__SS_lastSessionWindowID = "" + Date.now() + Math.random();
       this.SessionStoreGlobal.LastSession.setState(state);
       return state;
    },
@@ -2921,7 +2922,7 @@ try{
    loadSession: function SM_loadSession(path, caller, overwriteWindows) {
       let lastSession = this.gSessionPath[1];
       if (caller == "firstwindowopen" && path != lastSession)
-         this.setLastSession();
+         this.setLastSession(true);
       if (path == lastSession) {
          TabmixSvc.sm.lastSessionPath = null;
          TabmixSvc.ss.canRestoreLastSession = false;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list