Bug 609685 - "Having opened panorama once in a window affects all rendering in that window, even in tabs that are opened later" [f=ian r=ian a=blocking]

This commit is contained in:
Sean Dunn 2010-11-16 16:35:00 -06:00
Родитель 69869e5ba0
Коммит 35882f33b9
3 изменённых файлов: 51 добавлений и 12 удалений

Просмотреть файл

@ -1052,10 +1052,10 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
return: 'widthAndColumns',
count: count || this._children.length
};
let {childWidth, columns} = Items.arrange(null, bb, options);
let arrObj = Items.arrange(null, bb, options);
let shouldStack = childWidth < TabItems.minTabWidth * 1.35;
this._columns = shouldStack ? null : columns;
let shouldStack = arrObj.childWidth < TabItems.minTabWidth * 1.35;
this._columns = shouldStack ? null : arrObj.columns;
return shouldStack;
},
@ -1646,6 +1646,7 @@ let GroupItems = {
_arrangePaused: false,
_arrangesPending: [],
_removingHiddenGroups: false,
_delayedModUpdates: [],
minGroupHeight: 110,
minGroupWidth: 125,
@ -1659,9 +1660,18 @@ let GroupItems = {
self._handleAttrModified(xulTab);
}
// make sure any closed tabs are removed from the delay update list
function handleClose(xulTab) {
let idx = self._delayedModUpdates.indexOf(xulTab);
if (idx != -1)
self._delayedModUpdates.splice(idx, 1);
}
AllTabs.register("attrModified", handleAttrModified);
AllTabs.register("close", handleClose);
this._cleanupFunctions.push(function() {
AllTabs.unregister("attrModified", handleAttrModified);
AllTabs.unregister("close", handleClose);
});
},
@ -1728,6 +1738,30 @@ let GroupItems = {
// Function: _handleAttrModified
// watch for icon changes on app tabs
_handleAttrModified: function GroupItems__handleAttrModified(xulTab) {
if (!UI.isTabViewVisible()) {
if (this._delayedModUpdates.indexOf(xulTab) == -1) {
this._delayedModUpdates.push(xulTab);
}
} else
this._updateAppTabIcons(xulTab);
},
// ----------
// Function: flushTabUpdates
// Update apptab icons based on xulTabs which have been updated
// while the TabView hasn't been visible
flushAppTabUpdates: function GroupItems_flushAppTabUpdates() {
let self = this;
this._delayedModUpdates.forEach(function(xulTab) {
self._updateAppTabIcons(xulTab);
});
this._delayedModUpdates = [];
},
// ----------
// Function: _updateAppTabIcons
// Update images of any apptab icons that point to passed in xultab
_updateAppTabIcons: function GroupItems__updateAppTabIcons(xulTab) {
if (xulTab.ownerDocument.defaultView != gWindow || !xulTab.pinned)
return;

Просмотреть файл

@ -900,12 +900,9 @@ let TabItems = {
Date.now() - this._lastUpdateTime < this._heartbeatTiming
);
let isCurrentTab = (
!UI.isTabViewVisible() &&
tab == gBrowser.selectedTab
);
if (shouldDefer && !isCurrentTab) {
if (shouldDefer) {
if (!this.reconnectingPaused() && !tab._tabViewTabItem._reconnected)
this._reconnect(tab._tabViewTabItem);
if (this._tabsWaitingForUpdate.indexOf(tab) == -1)
this._tabsWaitingForUpdate.push(tab);
this.startHeartbeat();
@ -1297,7 +1294,9 @@ TabCanvas.prototype = {
ctx.save();
ctx.scale(scaler, scaler);
try{
ctx.drawWindow(fromWin, fromWin.scrollX, fromWin.scrollY, w/scaler, h/scaler, "#fff");
ctx.drawWindow(fromWin, fromWin.scrollX, fromWin.scrollY,
w/scaler, h/scaler, "#fff",
Ci.nsIDOMCanvasRenderingContext2D.DRAWWINDOW_DO_NOT_FLUSH);
} catch(e) {
Utils.error('paint', e);
}

Просмотреть файл

@ -500,6 +500,9 @@ let UI = {
self._resize(true);
dispatchEvent(event);
// Flush pending updates
GroupItems.flushAppTabUpdates();
TabItems.resumePainting();
});
} else {
@ -509,6 +512,9 @@ let UI = {
self.setActiveTab(null);
dispatchEvent(event);
// Flush pending updates
GroupItems.flushAppTabUpdates();
TabItems.resumePainting();
}
},