From 32613ba5445276336ff6d271246b28a5e3dee289 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sun, 12 May 2013 17:32:02 +0200 Subject: [PATCH] ScreenShield: switch resetLockScreen to accept keyword arguments Having two booleans as argument is just confusing. https://bugzilla.gnome.org/show_bug.cgi?id=699112 --- js/ui/screenShield.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index 942f3ebdd..8a13c5633 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -979,10 +979,11 @@ const ScreenShield = new Lang.Class({ }, _onUnlockFailed: function() { - this._resetLockScreen(true, false); + this._resetLockScreen({ animateLockScreen: true, + animateLockDialog: false }); }, - _resetLockScreen: function(animateLockScreen, animateLockDialog) { + _resetLockScreen: function(params) { // Don't reset the lock screen unless it is completely hidden // This prevents the shield going down if the lock-delay timeout // fires while the user is dragging (which has the potential @@ -997,7 +998,7 @@ const ScreenShield = new Lang.Class({ this._lockScreenGroup.show(); this._lockScreenState = MessageTray.State.SHOWING; - if (animateLockScreen) { + if (params.animateLockScreen) { this._lockScreenGroup.y = -global.screen_height; Tweener.removeTweens(this._lockScreenGroup); Tweener.addTween(this._lockScreenGroup, @@ -1014,7 +1015,7 @@ const ScreenShield = new Lang.Class({ this._lockScreenShown(); } - if (animateLockDialog) { + if (params.animateLockDialog) { this._lockDialogGroup.opacity = 0; Tweener.removeTweens(this._lockDialogGroup); Tweener.addTween(this._lockDialogGroup, @@ -1258,7 +1259,8 @@ const ScreenShield = new Lang.Class({ Main.sessionMode.pushMode('unlock-dialog'); } - this._resetLockScreen(animate, animate); + this._resetLockScreen({ animateLockScreen: animate, + animateLockDialog: animate }); global.set_runtime_state(LOCKED_STATE_STR, GLib.Variant.new('b', true)); // We used to set isActive and emit active-changed here,