[Pkg-mozext-commits] [tabmixplus] 07/30: TabmixSessionManager.onWindowClose notifyObservers "browser-window-change-state" before the window actualy closed by sessionStore. Regressed by changeset 523c7dac0d5e.

David Prévot taffit at moszumanska.debian.org
Sun Jun 14 22:15:36 UTC 2015


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 9c354f136ae2a84164c6f448cbc8d5172cb41575
Author: onemen <tabmix.onemen at gmail.com>
Date:   Thu Mar 26 19:41:18 2015 +0200

    TabmixSessionManager.onWindowClose notifyObservers "browser-window-change-state" before the window actualy closed by sessionStore. Regressed by changeset 523c7dac0d5e.
---
 chrome/content/session/session.js | 10 ++++++----
 chrome/content/tabmix.js          |  1 +
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index 361c503..675c6a0 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -670,8 +670,6 @@ var TabmixSessionManager = { // jshint ignore:line
 
     if (this._inited) {
       let obs = Services.obs;
-      obs.notifyObservers(null, "browser-window-change-state", "closed");
-      obs.removeObserver(this, "browser-window-change-state");
       obs.removeObserver(this, "sessionstore-windows-restored");
       obs.removeObserver(this, "sessionstore-browser-state-restored");
       obs.removeObserver(this, "quit-application-requested");
@@ -1272,8 +1270,12 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
      this.notifyClosedWindowsChanged();
    },
 
-   notifyClosedWindowsChanged: function SM_notifyClosedWindowsChanged() {
-     Services.obs.notifyObservers(null, "browser-window-change-state", "changed");
+   notifyClosedWindowsChanged: function SM_notifyClosedWindowsChanged(onClose) {
+     if (!this._inited)
+       return;
+     Services.obs.notifyObservers(null, "browser-window-change-state", onClose ? "closed" : "changed");
+     if (onClose)
+       Services.obs.removeObserver(this, "browser-window-change-state");
    },
 
    // enable/disable the Recently Closed Windows button
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index 471129f..9a19e7a 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -1039,6 +1039,7 @@ var TMP_eventListener = {
     }
 
     TabmixSessionManager.shutDown(true, isLastWindow, true);
+    TabmixSessionManager.notifyClosedWindowsChanged(true);
     TabmixTabClickOptions.toggleEventListener(false);
     TabmixContext.toggleEventListener(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