Screen Shield: animate manual locking

When the screen shield is activated from the user menu, animate
it instead of showing it abruptly. Also, ensure that the animation
had time to finish before calling UPower to suspend, to avoid
showing it when resuming.

https://bugzilla.gnome.org/show_bug.cgi?id=619955
This commit is contained in:
Giovanni Campagna
2012-06-03 00:10:23 +02:00
parent 34cb92ff4c
commit 0e4171a87c
2 changed files with 40 additions and 11 deletions

View File

@ -767,12 +767,12 @@ const UserMenuButton = new Lang.Class({
_onLockScreenActivate: function() {
Main.overview.hide();
Main.screenShield.lock();
Main.screenShield.lock(true);
},
_onLoginScreenActivate: function() {
Main.overview.hide();
Main.screenShield.lock();
Main.screenShield.lock(false);
this._userManager.goto_login_session();
},
@ -795,8 +795,13 @@ const UserMenuButton = new Lang.Class({
this._suspendOrPowerOffItem.state == PopupMenu.PopupAlternatingMenuItemState.DEFAULT) {
this._session.ShutdownRemote();
} else {
Main.screenShield.lock();
this._upClient.suspend_sync(null);
let tmpId = Main.screenShield.connect('lock-screen-shown', Lang.bind(this, function() {
Main.screenShield.disconnect(tmpId);
this._upClient.suspend_sync(null);
}));
Main.screenShield.lock(true);
}
}
});