[Pkg-mozext-commits] [tabmixplus] 125/147: Restore pinned tabs from last time is not working when the preference is 'Ask Before Restoring' and the user dismissed the dialog or select 'Don't Restore'. Related to bug 936061 - Refactor restoreWindow() into restoreWindow() and restoreWindows()

David Prévot taffit at moszumanska.debian.org
Sat Aug 5 15:27:44 UTC 2017


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 56673b24b6170178dfb66d9a0b5f4cfd302117d4
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Apr 9 15:30:13 2017 +0300

    Restore pinned tabs from last time is not working when the preference is 'Ask Before Restoring' and the user dismissed the dialog or select 'Don't Restore'. Related to bug 936061 - Refactor restoreWindow() into restoreWindow() and restoreWindows()
---
 chrome/content/session/session.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index b97fdbb..7eeb1e9 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -2454,6 +2454,13 @@ TabmixSessionManager = {
 
     let state = this.setLastSession();
     let iniState = TabmixSvc.SessionStore._prepDataForDeferredRestore(state)[0];
+    // prepDataForDeferredRestore set wrong selected index when the selected tab
+    // was pinned tab
+    for (let win of iniState.windows) {
+      if (win.tabs.length < win.selected) {
+        win.selected = 1;
+      }
+    }
     let pinnedExist = iniState.windows.length > 0;
     if (pinnedExist) {
       // move all tabs and closed tabs into one window
@@ -2464,7 +2471,8 @@ TabmixSessionManager = {
       let overwrite = TabmixSvc.SessionStore._isCmdLineEmpty(window, iniState);
       if (Tabmix.isVersion(260)) {
         let options = {firstWindow: true, overwriteTabs: overwrite};
-        TabmixSvc.SessionStore.restoreWindow(window, iniState, options);
+        const restoreFunction = Tabmix.isVersion(400) ? "restoreWindows" : "restoreWindow";
+        TabmixSvc.SessionStore[restoreFunction](window, iniState, options);
       } else {
         iniState._firstTabs = true;
         TabmixSvc.SessionStore.restoreWindow(window, iniState, overwrite);

-- 
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