screenShield: Use duration 0 when not animating
Instead of using a special branch for the not animate case, just use the same path with duration 0. Since commit ee09c5c85312f571e14abe69bb6674a361c16d65 we are sure that duration 0 is always preserved. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2987>
This commit is contained in:
parent
46219b1101
commit
b4676f0e9e
@ -397,25 +397,21 @@ export class ScreenShield extends Signals.EventEmitter {
|
|||||||
|
|
||||||
this._lockDialogGroup.remove_all_transitions();
|
this._lockDialogGroup.remove_all_transitions();
|
||||||
|
|
||||||
if (animate) {
|
// Animate the lock screen out of screen
|
||||||
// Animate the lock screen out of screen
|
// if velocity is not specified (i.e. we come here from pressing ESC),
|
||||||
// if velocity is not specified (i.e. we come here from pressing ESC),
|
// use the same speed regardless of original position
|
||||||
// use the same speed regardless of original position
|
// if velocity is specified, it's in pixels per milliseconds
|
||||||
// if velocity is specified, it's in pixels per milliseconds
|
const height = global.stage.height;
|
||||||
let h = global.stage.height;
|
const delta = height + this._lockDialogGroup.translation_y;
|
||||||
let delta = h + this._lockDialogGroup.translation_y;
|
const velocity = height / CURTAIN_SLIDE_TIME;
|
||||||
let velocity = global.stage.height / CURTAIN_SLIDE_TIME;
|
const duration = animate ? delta / velocity : 0;
|
||||||
let duration = delta / velocity;
|
|
||||||
|
|
||||||
this._lockDialogGroup.ease({
|
this._lockDialogGroup.ease({
|
||||||
translation_y: -h,
|
translation_y: -height,
|
||||||
duration,
|
duration,
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||||
onComplete: () => this._hideLockScreenComplete(),
|
onComplete: () => this._hideLockScreenComplete(),
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
this._hideLockScreenComplete();
|
|
||||||
}
|
|
||||||
|
|
||||||
this._showPointer();
|
this._showPointer();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user