mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 684773 - Unpin all tabs earlier when restoring a session in overwriting mode; r=dietrich
This commit is contained in:
parent
28beac255b
commit
205944c60f
@ -2590,7 +2590,7 @@ SessionStoreService.prototype = {
|
||||
(!winData.tabs[0].entries || winData.tabs[0].entries.length == 0)) {
|
||||
winData.tabs = [];
|
||||
}
|
||||
|
||||
|
||||
var tabbrowser = aWindow.gBrowser;
|
||||
var openTabCount = aOverwriteTabs ? tabbrowser.browsers.length : -1;
|
||||
var newTabCount = winData.tabs.length;
|
||||
@ -2600,11 +2600,6 @@ SessionStoreService.prototype = {
|
||||
var tabstrip = tabbrowser.tabContainer.mTabstrip;
|
||||
var smoothScroll = tabstrip.smoothScroll;
|
||||
tabstrip.smoothScroll = false;
|
||||
|
||||
// make sure that the selected tab won't be closed in order to
|
||||
// prevent unnecessary flickering
|
||||
if (aOverwriteTabs && tabbrowser.selectedTab._tPos >= newTabCount)
|
||||
tabbrowser.moveTabTo(tabbrowser.selectedTab, newTabCount - 1);
|
||||
|
||||
// unpin all tabs to ensure they are not reordered in the next loop
|
||||
if (aOverwriteTabs) {
|
||||
@ -2612,6 +2607,11 @@ SessionStoreService.prototype = {
|
||||
tabbrowser.unpinTab(tabbrowser.tabs[t]);
|
||||
}
|
||||
|
||||
// make sure that the selected tab won't be closed in order to
|
||||
// prevent unnecessary flickering
|
||||
if (aOverwriteTabs && tabbrowser.selectedTab._tPos >= newTabCount)
|
||||
tabbrowser.moveTabTo(tabbrowser.selectedTab, newTabCount - 1);
|
||||
|
||||
for (var t = 0; t < newTabCount; t++) {
|
||||
tabs.push(t < openTabCount ?
|
||||
tabbrowser.tabs[t] :
|
||||
|
Loading…
Reference in New Issue
Block a user