screenShield: Cleanup unused method arguments

The 'velocity' argument is not used anymore, since the only
caller passing a different value than 0 was the drag motion
callback.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/872
This commit is contained in:
Georges Basile Stavracas Neto 2019-11-28 20:05:51 -03:00 committed by Florian Müllner
parent 66a3ad42da
commit 308b4f81b5

View File

@ -88,14 +88,14 @@ var ScreenShield = class {
this._smartcardManager.connect('smartcard-inserted', this._smartcardManager.connect('smartcard-inserted',
(manager, token) => { (manager, token) => {
if (this._isLocked && token.UsedToLogin) if (this._isLocked && token.UsedToLogin)
this._liftShield(0); this._liftShield();
}); });
this._oVirtCredentialsManager = OVirt.getOVirtCredentialsManager(); this._oVirtCredentialsManager = OVirt.getOVirtCredentialsManager();
this._oVirtCredentialsManager.connect('user-authenticated', this._oVirtCredentialsManager.connect('user-authenticated',
() => { () => {
if (this._isLocked) if (this._isLocked)
this._liftShield(0); this._liftShield();
}); });
this._loginManager = LoginManager.getLoginManager(); this._loginManager = LoginManager.getLoginManager();
@ -159,10 +159,10 @@ var ScreenShield = class {
this._syncInhibitor(); this._syncInhibitor();
} }
_liftShield(velocity) { _liftShield() {
if (this._isLocked) { if (this._isLocked) {
if (this._ensureUnlockDialog(true /* allowCancel */)) if (this._ensureUnlockDialog(true /* allowCancel */))
this._hideLockScreen(true /* animate */, velocity); this._hideLockScreen(true /* animate */);
} else { } else {
this.deactivate(true /* animate */); this.deactivate(true /* animate */);
} }
@ -222,7 +222,7 @@ var ScreenShield = class {
GLib.unichar_isgraph(unichar)) GLib.unichar_isgraph(unichar))
this._dialog.addCharacter(unichar); this._dialog.addCharacter(unichar);
this._liftShield(0); this._liftShield();
return Clutter.EVENT_STOP; return Clutter.EVENT_STOP;
} }
@ -240,7 +240,7 @@ var ScreenShield = class {
// 7 standard scrolls to lift up // 7 standard scrolls to lift up
if (this._lockScreenScrollCounter > 35) if (this._lockScreenScrollCounter > 35)
this._liftShield(0); this._liftShield();
return Clutter.EVENT_STOP; return Clutter.EVENT_STOP;
} }
@ -379,7 +379,7 @@ var ScreenShield = class {
this._isGreeter = Main.sessionMode.isGreeter; this._isGreeter = Main.sessionMode.isGreeter;
this._isLocked = true; this._isLocked = true;
if (this._ensureUnlockDialog(true)) if (this._ensureUnlockDialog(true))
this._hideLockScreen(false, 0); this._hideLockScreen(false);
} }
_hideLockScreenComplete() { _hideLockScreenComplete() {
@ -395,7 +395,7 @@ var ScreenShield = class {
} }
} }
_hideLockScreen(animate, velocity) { _hideLockScreen(animate) {
if (this._lockScreenState == MessageTray.State.HIDDEN) if (this._lockScreenState == MessageTray.State.HIDDEN)
return; return;
@ -410,9 +410,7 @@ var ScreenShield = class {
// if velocity is specified, it's in pixels per milliseconds // if velocity is specified, it's in pixels per milliseconds
let h = global.stage.height; let h = global.stage.height;
let delta = h + this._lockScreenGroup.translation_y; let delta = h + this._lockScreenGroup.translation_y;
let minVelocity = global.stage.height / CURTAIN_SLIDE_TIME; let velocity = global.stage.height / CURTAIN_SLIDE_TIME;
velocity = Math.max(minVelocity, velocity);
let duration = delta / velocity; let duration = delta / velocity;
this._lockScreenGroup.ease({ this._lockScreenGroup.ease({
@ -560,7 +558,7 @@ var ScreenShield = class {
} }
_continueDeactivate(animate) { _continueDeactivate(animate) {
this._hideLockScreen(animate, 0); this._hideLockScreen(animate);
if (Main.sessionMode.currentMode == 'lock-screen') if (Main.sessionMode.currentMode == 'lock-screen')
Main.sessionMode.popMode('lock-screen'); Main.sessionMode.popMode('lock-screen');