ScreenShield: use a longer animation when locking manually

The curtain animation looks jerky at its current speed, and more so if
we blank the screen immediately at the end. Make it a little slower and
it becomes more confortable.

https://bugzilla.gnome.org/show_bug.cgi?id=691964
This commit is contained in:
Giovanni Campagna 2013-01-29 16:04:19 +01:00
parent 2138fc2349
commit 2b1a661614

View File

@ -29,7 +29,6 @@ const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver';
const LOCK_ENABLED_KEY = 'lock-enabled'; const LOCK_ENABLED_KEY = 'lock-enabled';
const LOCK_DELAY_KEY = 'lock-delay'; const LOCK_DELAY_KEY = 'lock-delay';
const CURTAIN_SLIDE_TIME = 0.3;
// fraction of screen height the arrow must reach before completing // fraction of screen height the arrow must reach before completing
// the slide up automatically // the slide up automatically
const ARROW_DRAG_THRESHOLD = 0.1; const ARROW_DRAG_THRESHOLD = 0.1;
@ -46,11 +45,14 @@ const BUMP_TIME = 0.3;
const SUMMARY_ICON_SIZE = 48; const SUMMARY_ICON_SIZE = 48;
// Lightbox fading times // ScreenShield animation time
// STANDARD_FADE_TIME is used when the session goes idle, while // - STANDARD_FADE_TIME is used when the session goes idle
// SHORT_FADE_TIME is used when requesting lock explicitly from the user menu // - MANUAL_FADE_TIME is used for lowering the shield when asked by the user,
// or when cancelling the dialog
// - CURTAIN_SLIDE_TIME is used when raising the shield before unlocking
const STANDARD_FADE_TIME = 10; const STANDARD_FADE_TIME = 10;
const SHORT_FADE_TIME = 0.3; const MANUAL_FADE_TIME = 0.8;
const CURTAIN_SLIDE_TIME = 0.3;
function sample(offx, offy) { function sample(offx, offy) {
return 'texel += texture2D (sampler, tex_coord.st + pixel_step * ' + return 'texel += texture2D (sampler, tex_coord.st + pixel_step * ' +
@ -689,7 +691,7 @@ const ScreenShield = new Lang.Class({
// restore the lock screen to its original place // restore the lock screen to its original place
// try to use the same speed as the normal animation // try to use the same speed as the normal animation
let h = global.stage.height; let h = global.stage.height;
let time = CURTAIN_SLIDE_TIME * (-this._lockScreenGroup.y) / h; let time = MANUAL_FADE_TIME * (-this._lockScreenGroup.y) / h;
Tweener.removeTweens(this._lockScreenGroup); Tweener.removeTweens(this._lockScreenGroup);
Tweener.addTween(this._lockScreenGroup, Tweener.addTween(this._lockScreenGroup,
{ y: 0, { y: 0,
@ -930,7 +932,7 @@ const ScreenShield = new Lang.Class({
Tweener.removeTweens(this._lockScreenGroup); Tweener.removeTweens(this._lockScreenGroup);
Tweener.addTween(this._lockScreenGroup, Tweener.addTween(this._lockScreenGroup,
{ y: 0, { y: 0,
time: SHORT_FADE_TIME, time: MANUAL_FADE_TIME,
transition: 'easeOutQuad', transition: 'easeOutQuad',
onComplete: function() { onComplete: function() {
this._lockScreenShown(); this._lockScreenShown();
@ -947,7 +949,7 @@ const ScreenShield = new Lang.Class({
Tweener.removeTweens(this._lockDialogGroup); Tweener.removeTweens(this._lockDialogGroup);
Tweener.addTween(this._lockDialogGroup, Tweener.addTween(this._lockDialogGroup,
{ opacity: 255, { opacity: 255,
time: SHORT_FADE_TIME, time: MANUAL_FADE_TIME,
transition: 'easeOutQuad' }); transition: 'easeOutQuad' });
} else { } else {
this._lockDialogGroup.opacity = 255; this._lockDialogGroup.opacity = 255;