From 5718fef495fb2fe50c37a50c3a1678032cbece76 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Wed, 5 Dec 2012 11:35:37 +0900 Subject: [PATCH] Collapse/hide the tab bar automatically even if the webpage includes any plugin area Logic A) Tab bar autohide is intentionally blocked by opened popup because the tab bar should not be hidden while you open a context menu on the tab bar. Logic B) On the other hand, TST shows hidden popup on the content area if the webpage includes any plugin area, because Firefox cannot receive mousemove events on plugin areas. As the result, the hidden popup unexpectedly blocked to hide the tab bar... The popup for the logic B must be ignored by the logic A. --- content/treestyletab/treestyletab.xul | 1 + modules/base.js | 1 + modules/window.js | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/content/treestyletab/treestyletab.xul b/content/treestyletab/treestyletab.xul index 777234d4..891fc244 100644 --- a/content/treestyletab/treestyletab.xul +++ b/content/treestyletab/treestyletab.xul @@ -144,6 +144,7 @@ diff --git a/modules/base.js b/modules/base.js index 1efbfde5..a922479c 100644 --- a/modules/base.js +++ b/modules/base.js @@ -124,6 +124,7 @@ var TreeStyleTabBase = { kNARROW_SCROLLBAR : 'treestyletab-narrow-scrollbar', kFAVICONIZED : 'treestyletab-faviconized', kBG_NOTIFY_PHASE : 'treestyletab-notifybgtab-phase', + kIGNORE_POPUP_STATE : 'treestyletab-ignore-state', kTAB_INVERTED : 'treestyletab-tab-inverted', kTAB_CONTENTS_INVERTED : 'treestyletab-tab-contents-inverted', diff --git a/modules/window.js b/modules/window.js index 0cb50682..ab9e1c69 100644 --- a/modules/window.js +++ b/modules/window.js @@ -1084,7 +1084,13 @@ TreeStyleTabWindow.prototype = { this._shownPopups = this._shownPopups.filter(function(aItem) { if (typeof aItem == 'string') aItem = this.document.getElementById(aItem); - return aItem && aItem.boxObject && ((aItem.boxObject.width || aItem.boxObject.height) && aItem.state != 'closed'); + return ( + aItem && + aItem.getAttribute(this.kIGNORE_POPUP_STATE) != 'true' && + aItem.boxObject && + (aItem.boxObject.width || aItem.boxObject.height) && + aItem.state != 'closed' + ); }, this); return this._shownPopups.length > 0; },