From 36e8eeea2cbde0bb205644f6fbfc677d2db75114 Mon Sep 17 00:00:00 2001 From: piro Date: Tue, 6 Apr 2010 13:59:13 +0000 Subject: [PATCH] =?UTF-8?q?AeroPeek=E9=96=A2=E4=BF=82=E3=81=AB=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E3=80=81=E6=9C=80=E5=B0=8F=E9=99=90=E3=81=AE?= =?UTF-8?q?=E5=AE=9F=E8=A3=85=E3=81=A7=E6=B8=88=E3=81=BE=E3=81=9B=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6573 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 14 +++++++---- modules/utils.js | 37 ---------------------------- 2 files changed, 9 insertions(+), 42 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index c64289fd..04f1845d 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -1545,7 +1545,6 @@ catch(e) { this.updateAeroPeekPreviewsTimer || !('Win7Features' in window) || !window.Win7Features || - !Win7Features.onOpenWindow || !this.AeroPeek || !this.AeroPeek.windows ) @@ -1553,8 +1552,14 @@ catch(e) { this.updateAeroPeekPreviewsTimer = window.setTimeout(function(aSelf) { aSelf.updateAeroPeekPreviewsTimer = null; - aSelf.updateAeroPeekPreviewsInternal(); - }, 50, this); + try { + aSelf.updateAeroPeekPreviewsInternal(); + } + catch(e) { + dump(e+'\n'); + aSelf.updateAeroPeekPreviews(); + } + }, 250, this); }, updateAeroPeekPreviewsTimer : null, updateAeroPeekPreviewsInternal : function TSTService_updateAeroPeekPreviewsInternal() @@ -1564,9 +1569,8 @@ catch(e) { aTabWindow.previews.forEach(function(aPreview) { if (!aPreview) return; var tab = aPreview.controller.wrappedJSObject.tab; - return aPreview.visible = tab.getAttribute(this.AeroPeek.__treestyletab__kCOLLAPSED) != 'true'; + aPreview.visible = tab.getAttribute(this.kCOLLAPSED) != 'true'; }, this); - aTabWindow.updateTabOrdering(); this.AeroPeek.checkPreviewCount(); return true; } diff --git a/modules/utils.js b/modules/utils.js index e5175fe9..fc65eb8b 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -273,43 +273,6 @@ var TreeStyleTabUtils = { var ns = {}; Components.utils.import('resource://gre/modules/WindowsPreviewPerTab.jsm', ns); this.AeroPeek = ns.AeroPeek; - - // don't override twice! - if (this.AeroPeek.__lookupGetter__('previews')) - return; - - this.AeroPeek.__treestyletab__previews = this.AeroPeek.previews; - - this.AeroPeek.__treestyletab__kCOLLAPSED = this.kCOLLAPSED; - this.AeroPeek.__defineGetter__('previews', function() { - var original = this.__treestyletab__previews; - - // clean up the array (for unknown errors) - this.__treestyletab__previews = original = original.filter(function(aPreview) { - return aPreview; - }); - - // ignore collapsed tabs! - var filtered = original.filter(function(aPreview) { - var tab = aPreview.controller.wrappedJSObject.tab; - return aPreview.visible = tab.getAttribute(this.__treestyletab__kCOLLAPSED) != 'true'; - }); - filtered.push = function(aItem) { - original.push(aItem); - }; - filtered.splice = function(aIndex, aLength, aInserted) { - var index = original.indexOf(filtered[aIndex]); - original.splice(index, aLength, aInserted); - }; - filtered.forEach = function(aCallback, aThis) { - original.forEach(aCallback, aThis); - }; - return filtered; - }); - - this.AeroPeek.__defineSetter__('previews', function(aValue) { - return this.__treestyletab__previews = aValue; - }); }, observe : function TSTUtils_observe(aSubject, aTopic, aData)