[Pkg-mozext-commits] [tabmixplus] 05/28: Follow up bug 947854 - Exiting DOM fullscreen also exits window fullscreen mode, Bug 1161802 part 2 - Split nsGlobalWindow::SetFullScreenInternal into two parts, one part before the window resizing, the other after.

David Prévot taffit at moszumanska.debian.org
Sun Jul 5 15:02:33 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 837e7e5473e3d68353159ed905f98be1b65d0502
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Jun 14 18:57:19 2015 +0300

    Follow up bug 947854 - Exiting DOM fullscreen also exits window fullscreen mode,
    Bug 1161802 part 2 - Split nsGlobalWindow::SetFullScreenInternal into two parts, one part before the window resizing, the other after.
---
 chrome/content/minit/tablib.js   | 16 +++++++++++++++-
 chrome/content/tab/scrollbox.xml |  7 ++++++-
 chrome/content/tab/tab.js        |  5 +++--
 chrome/content/tabmix.js         | 35 ++++++++++++++++++++++++++++++-----
 4 files changed, 54 insertions(+), 9 deletions(-)

diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 373acb5..b98277a 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -480,13 +480,27 @@ var tablib = {
   },
 
   change_utility: function change_utility() {
+    // FullScreen code related to tabs bellow content initialize by first
+    // fullScreen event, see TMP_eventListener.onFullScreen
+    if (Tabmix.isVersion(400)) {
+      let $LF = '\n    ';
+      Tabmix.changeCode(FullScreen, "FullScreen.showNavToolbox")._replace(
+        'gNavToolbox.style.marginTop = "";',
+        '$&' + $LF +
+        'TMP_eventListener._updateMarginBottom("");' + $LF +
+        'TMP_eventListener.toggleTabbarVisibility(true);' + $LF +
+        'TMP_eventListener.updateMultiRow();' + $LF +
+        'setTimeout(function() {TMP_eventListener.updateMultiRow();},0);'
+      ).toCode();
+    }
+    else
     Tabmix.changeCode(FullScreen, "FullScreen.mouseoverToggle")._replace(
       'this._isChromeCollapsed = !aShow;',
       '  $&' +
       '  if (aShow)' +
       '    TMP_eventListener.updateMultiRow();' +
       '  if (TabmixTabbar.position == 1) {' +
-      '    TMP_eventListener.mouseoverToggle(aShow);' +
+      '    TMP_eventListener.toggleTabbarVisibility(aShow);' +
       '  }'
     ).toCode();
 
diff --git a/chrome/content/tab/scrollbox.xml b/chrome/content/tab/scrollbox.xml
index ca60939..e5f7bb4 100644
--- a/chrome/content/tab/scrollbox.xml
+++ b/chrome/content/tab/scrollbox.xml
@@ -629,7 +629,7 @@
 
       <method name="updatePosition">
         <body><![CDATA[
-          let tabBar = gBrowser.tabContainer;
+          let updateFullScreen, tabBar = gBrowser.tabContainer;
           Tabmix.setItem(tabBar.mTabstrip, "flowing", TabmixTabbar.flowing);
           Tabmix.tabsUtils.tabstripInnerbox = document.getAnonymousElementByAttribute(
             tabBar.mTabstrip._scrollbox, "class", "box-inherit scrollbox-innerbox");
@@ -644,6 +644,7 @@
             // remember to fix background css rules for all platform
             let warningContainer = document.getElementById("full-screen-warning-container");
             warningContainer.parentNode.insertBefore(bottomToolbox, warningContainer);
+            updateFullScreen = window.fullScreen;
           }
           if (tabBar.visible)
             gTMPprefObserver.updateTabbarBottomPosition();
@@ -657,6 +658,10 @@
           }
           // force TabmixTabbar.setHeight to set tabbar height
           TabmixTabbar.visibleRows = 1;
+          if (updateFullScreen) {
+            TMP_eventListener.toggleTabbarVisibility(false);
+            TabmixTabbar.updateSettings(false);
+          }
         ]]></body>
       </method>
 
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index 22114a6..e0f2326 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -1332,8 +1332,9 @@ var gTMPprefObserver = {
          if (this.tabBarPositionChanged(Services.prefs.getIntPref(prefName))) {
            if (window.fullScreen) {
              TMP_eventListener.onFullScreen(true);
-             if (TabmixTabbar.position == 1)
-               TMP_eventListener.mouseoverToggle(false);
+             let bottomToolbox = document.getElementById("tabmix-bottom-toolbox");
+             if (bottomToolbox)
+               TMP_eventListener.toggleTabbarVisibility(false);
            }
            TabmixTabbar.updateSettings(false);
          }
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index 7f3397a..0268b92 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -303,7 +303,12 @@ var TMP_eventListener = {
         this.onWindowClose(aEvent);
         break;
       case "fullscreen":
-        this.onFullScreen(!window.fullScreen);
+        let enterFS = window.fullScreen;
+        // Until Firefox 41 (Bug 1161802 part 2) we get the fullscreen event
+        // before the window transitions into or out of FS mode.
+        if (!Tabmix.isVersion(410))
+          enterFS = !enterFS;
+        this.onFullScreen(enterFS);
         break;
       case "PrivateTab:PrivateChanged":
         TabmixSessionManager.privateTabChanged(aEvent);
@@ -675,6 +680,16 @@ var TMP_eventListener = {
         let bottombox = document.getElementById("browser-bottombox");
         bottombox.appendChild(fullScrToggler);
 
+        if (Tabmix.isVersion(400)) {
+          let $LF = '\n    ';
+          Tabmix.changeCode(FullScreen, "FullScreen.hideNavToolbox")._replace(
+            'this._isChromeCollapsed = true;',
+            'TMP_eventListener._updateMarginBottom(gNavToolbox.style.marginTop);' + $LF +
+            '$&' + $LF +
+            'TMP_eventListener.toggleTabbarVisibility(false);'
+          ).toCode();
+        }
+        else
         Tabmix.changeCode(FullScreen, "FullScreen.sample")._replace(
           'gNavToolbox.style.marginTop = "";',
           'TMP_eventListener._updateMarginBottom("");\
@@ -719,11 +734,18 @@ var TMP_eventListener = {
   },
 
   _expandCallback: function TMP_EL__expandCallback() {
-    if (TabmixTabbar.hideMode === 0 || TabmixTabbar.hideMode == 1 && gBrowser.tabs.length > 1)
-      FullScreen.mouseoverToggle(true);
+    if (TabmixTabbar.hideMode === 0 || TabmixTabbar.hideMode == 1 && gBrowser.tabs.length > 1) {
+      if (Tabmix.isVersion(400))
+        FullScreen.showNavToolbox();
+      else
+        FullScreen.mouseoverToggle(true);
+    }
   },
 
-  mouseoverToggle: function (aShow) {
+  // for tabs bellow content
+  toggleTabbarVisibility: function (aShow) {
+    if (TabmixTabbar.position != 1)
+      return;
     document.getElementById("fullscr-bottom-toggler").collapsed = aShow;
     let bottomToolbox = document.getElementById("tabmix-bottom-toolbox");
     if (aShow) {
@@ -732,10 +754,13 @@ var TMP_eventListener = {
     }
     else {
       let bottombox = document.getElementById("browser-bottombox");
-      // changing the margin trigger resize event that calls updateTabbarBottomPosition
       bottomToolbox.style.marginBottom =
           -(bottomToolbox.getBoundingClientRect().height +
           bottombox.getBoundingClientRect().height) + "px";
+      // Until Firefox 41 changing the margin trigger resize event that calls
+      // updateTabbarBottomPosition
+      if (Tabmix.isVersion(410))
+        gTMPprefObserver.updateTabbarBottomPosition();
     }
   },
 

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