mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 594644 part 2 r=dietrich a=blocking
This commit is contained in:
parent
ac8932f36d
commit
a2a34ef9c6
@ -1559,6 +1559,7 @@ let GroupItems = {
|
||||
_arrangePaused: false,
|
||||
_arrangesPending: [],
|
||||
_removingHiddenGroups: false,
|
||||
_updatingTabBarPaused: false,
|
||||
|
||||
// ----------
|
||||
// Function: init
|
||||
@ -1991,6 +1992,25 @@ let GroupItems = {
|
||||
this._activeOrphanTab = tabItem;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: pauseUpdatingTabBar
|
||||
// Don't update the tab bar until resume is called.
|
||||
pauseUpdatingTabBar: function GroupItems_pauseUdatingTabBar() {
|
||||
Utils.assertThrow(!this._updatingTabBarPaused, "shouldn't already be paused");
|
||||
|
||||
this._updatingTabBarPaused = true;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: resumeUpdatingTabBar
|
||||
// Allows updating the tab bar, and does an update.
|
||||
resumeUpdatingTabBar: function GroupItems_resumeUpdatingTabBar() {
|
||||
Utils.assertThrow(this._updatingTabBarPaused, "should already be paused");
|
||||
|
||||
this._updatingTabBarPaused = false;
|
||||
this._updateTabBar();
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: _updateTabBar
|
||||
// Hides and shows tabs in the tab bar based on the active groupItem or
|
||||
@ -1998,6 +2018,9 @@ let GroupItems = {
|
||||
_updateTabBar: function GroupItems__updateTabBar() {
|
||||
if (!window.UI)
|
||||
return; // called too soon
|
||||
|
||||
if (this._updatingTabBarPaused)
|
||||
return;
|
||||
|
||||
if (!this._activeGroupItem && !this._activeOrphanTab) {
|
||||
Utils.assert(false, "There must be something to show in the tab bar!");
|
||||
|
@ -537,6 +537,7 @@ let UI = {
|
||||
self._privateBrowsing.transitionStage = 0;
|
||||
self._privateBrowsing.transitionMode = "";
|
||||
TabItems.resumeReconnecting();
|
||||
GroupItems.resumeUpdatingTabBar();
|
||||
}
|
||||
}
|
||||
|
||||
@ -571,6 +572,7 @@ let UI = {
|
||||
if (aData == "enter" || aData == "exit") {
|
||||
self._privateBrowsing.transitionStage = 1;
|
||||
self._privateBrowsing.transitionMode = aData;
|
||||
GroupItems.pauseUpdatingTabBar();
|
||||
TabItems.pauseReconnecting();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user