userMenu: Don't update the presence icon immediately
If we don't freeze the presence icon, we can end up in a place where we'll be updating the icon before we fade out the panel indicators when coming back from the lock screen. https://bugzilla.gnome.org/show_bug.cgi?id=683156
This commit is contained in:
parent
ec01f5d5ee
commit
f1ca96bbf0
@ -1131,7 +1131,7 @@ const Panel = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_tweenAndUpdatePanel: function() {
|
_tweenAndUpdatePanel: function() {
|
||||||
this._closeIndicatorMenus();
|
this._freezeAndCloseIndicators();
|
||||||
|
|
||||||
Tweener.addTween(this, {
|
Tweener.addTween(this, {
|
||||||
boxOpacity: 0,
|
boxOpacity: 0,
|
||||||
@ -1140,6 +1140,7 @@ const Panel = new Lang.Class({
|
|||||||
onCompleteScope: this,
|
onCompleteScope: this,
|
||||||
onComplete: function() {
|
onComplete: function() {
|
||||||
this._updatePanel();
|
this._updatePanel();
|
||||||
|
this._thawIndicators();
|
||||||
Tweener.addTween(this, {
|
Tweener.addTween(this, {
|
||||||
boxOpacity: 255,
|
boxOpacity: 255,
|
||||||
time: Overview.ANIMATION_TIME / 2,
|
time: Overview.ANIMATION_TIME / 2,
|
||||||
@ -1153,13 +1154,21 @@ const Panel = new Lang.Class({
|
|||||||
this._tweenAndUpdatePanel();
|
this._tweenAndUpdatePanel();
|
||||||
},
|
},
|
||||||
|
|
||||||
_closeIndicatorMenus: function() {
|
_freezeAndCloseIndicators: function() {
|
||||||
for (let role in this.statusArea) {
|
for (let role in this.statusArea) {
|
||||||
let indicator = this.statusArea[role];
|
let indicator = this.statusArea[role];
|
||||||
|
indicator.freeze();
|
||||||
indicator.menu.close();
|
indicator.menu.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_thawIndicators: function() {
|
||||||
|
for (let role in this.statusArea) {
|
||||||
|
let indicator = this.statusArea[role];
|
||||||
|
indicator.thaw();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
_hideIndicators: function() {
|
_hideIndicators: function() {
|
||||||
for (let role in PANEL_ITEM_IMPLEMENTATIONS) {
|
for (let role in PANEL_ITEM_IMPLEMENTATIONS) {
|
||||||
let indicator = this.statusArea[role];
|
let indicator = this.statusArea[role];
|
||||||
|
@ -113,6 +113,21 @@ const Button = new Lang.Class({
|
|||||||
this.setMenu(new PopupMenu.PopupMenu(this.actor, menuAlignment, St.Side.TOP, 0));
|
this.setMenu(new PopupMenu.PopupMenu(this.actor, menuAlignment, St.Side.TOP, 0));
|
||||||
|
|
||||||
this.setName(nameText);
|
this.setName(nameText);
|
||||||
|
this._frozenCount = 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
freeze: function() {
|
||||||
|
this._frozenCount++;
|
||||||
|
},
|
||||||
|
|
||||||
|
thaw: function() {
|
||||||
|
this._frozenCount--;
|
||||||
|
if (this._frozenCount == 0)
|
||||||
|
this.emit('thawed');
|
||||||
|
},
|
||||||
|
|
||||||
|
get frozen() {
|
||||||
|
return this._frozenCount > 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
setSensitive: function(sensitive) {
|
setSensitive: function(sensitive) {
|
||||||
|
@ -574,6 +574,8 @@ const UserMenuButton = new Lang.Class({
|
|||||||
|
|
||||||
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
|
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
|
||||||
this._sessionUpdated();
|
this._sessionUpdated();
|
||||||
|
|
||||||
|
this.connect('thawed', Lang.bind(this, this._onThawed));
|
||||||
},
|
},
|
||||||
|
|
||||||
_sessionUpdated: function() {
|
_sessionUpdated: function() {
|
||||||
@ -666,6 +668,9 @@ const UserMenuButton = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_updatePresenceIcon: function(accountMgr, presence, status, message) {
|
_updatePresenceIcon: function(accountMgr, presence, status, message) {
|
||||||
|
if (this.frozen)
|
||||||
|
return;
|
||||||
|
|
||||||
if (Main.sessionMode.isLocked)
|
if (Main.sessionMode.isLocked)
|
||||||
this._iconBox.child = this._lockedIcon;
|
this._iconBox.child = this._lockedIcon;
|
||||||
else if (presence == Tp.ConnectionPresenceType.AVAILABLE)
|
else if (presence == Tp.ConnectionPresenceType.AVAILABLE)
|
||||||
@ -798,6 +803,10 @@ const UserMenuButton = new Lang.Class({
|
|||||||
this._presence.status = status;
|
this._presence.status = status;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_onThawed: function() {
|
||||||
|
this._updatePresenceIcon();
|
||||||
|
},
|
||||||
|
|
||||||
_onMyAccountActivate: function() {
|
_onMyAccountActivate: function() {
|
||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
let app = Shell.AppSystem.get_default().lookup_setting('gnome-user-accounts-panel.desktop');
|
let app = Shell.AppSystem.get_default().lookup_setting('gnome-user-accounts-panel.desktop');
|
||||||
|
Loading…
Reference in New Issue
Block a user