screenShield: Lift the unlock dialog
Instead of scaling it, lift the unlock dialog when unlocking, and vice-versa. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/872
This commit is contained in:
parent
a3a00434b1
commit
c937103071
@ -5,14 +5,12 @@ const { AccountsService, Clutter, Gio,
|
|||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const GnomeSession = imports.misc.gnomeSession;
|
const GnomeSession = imports.misc.gnomeSession;
|
||||||
const OVirt = imports.gdm.oVirt;
|
|
||||||
const LoginManager = imports.misc.loginManager;
|
const LoginManager = imports.misc.loginManager;
|
||||||
const Lightbox = imports.ui.lightbox;
|
const Lightbox = imports.ui.lightbox;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const Overview = imports.ui.overview;
|
const Overview = imports.ui.overview;
|
||||||
const MessageTray = imports.ui.messageTray;
|
const MessageTray = imports.ui.messageTray;
|
||||||
const ShellDBus = imports.ui.shellDBus;
|
const ShellDBus = imports.ui.shellDBus;
|
||||||
const SmartcardManager = imports.misc.smartcardManager;
|
|
||||||
|
|
||||||
const { adjustAnimationTime } = imports.ui.environment;
|
const { adjustAnimationTime } = imports.ui.environment;
|
||||||
|
|
||||||
@ -82,20 +80,6 @@ var ScreenShield = class {
|
|||||||
|
|
||||||
this._screenSaverDBus = new ShellDBus.ScreenSaverDBus(this);
|
this._screenSaverDBus = new ShellDBus.ScreenSaverDBus(this);
|
||||||
|
|
||||||
this._smartcardManager = SmartcardManager.getSmartcardManager();
|
|
||||||
this._smartcardManager.connect('smartcard-inserted',
|
|
||||||
(manager, token) => {
|
|
||||||
if (this._isLocked && token.UsedToLogin)
|
|
||||||
this._liftShield();
|
|
||||||
});
|
|
||||||
|
|
||||||
this._oVirtCredentialsManager = OVirt.getOVirtCredentialsManager();
|
|
||||||
this._oVirtCredentialsManager.connect('user-authenticated',
|
|
||||||
() => {
|
|
||||||
if (this._isLocked)
|
|
||||||
this._liftShield();
|
|
||||||
});
|
|
||||||
|
|
||||||
this._loginManager = LoginManager.getLoginManager();
|
this._loginManager = LoginManager.getLoginManager();
|
||||||
this._loginManager.connect('prepare-for-sleep',
|
this._loginManager.connect('prepare-for-sleep',
|
||||||
this._prepareForSleep.bind(this));
|
this._prepareForSleep.bind(this));
|
||||||
@ -157,15 +141,6 @@ var ScreenShield = class {
|
|||||||
this._syncInhibitor();
|
this._syncInhibitor();
|
||||||
}
|
}
|
||||||
|
|
||||||
_liftShield() {
|
|
||||||
if (this._isLocked) {
|
|
||||||
if (this._ensureUnlockDialog(true /* allowCancel */))
|
|
||||||
this._hideLockScreen(true /* animate */);
|
|
||||||
} else {
|
|
||||||
this.deactivate(true /* animate */);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_maybeCancelDialog() {
|
_maybeCancelDialog() {
|
||||||
if (!this._dialog)
|
if (!this._dialog)
|
||||||
return;
|
return;
|
||||||
@ -220,7 +195,6 @@ var ScreenShield = class {
|
|||||||
GLib.unichar_isgraph(unichar))
|
GLib.unichar_isgraph(unichar))
|
||||||
this._dialog.addCharacter(unichar);
|
this._dialog.addCharacter(unichar);
|
||||||
|
|
||||||
this._liftShield();
|
|
||||||
return Clutter.EVENT_STOP;
|
return Clutter.EVENT_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,6 +370,12 @@ var ScreenShield = class {
|
|||||||
translation_y: -h,
|
translation_y: -h,
|
||||||
duration,
|
duration,
|
||||||
mode: Clutter.AnimationMode.EASE_IN_QUAD,
|
mode: Clutter.AnimationMode.EASE_IN_QUAD,
|
||||||
|
});
|
||||||
|
|
||||||
|
this._lockDialogGroup.ease({
|
||||||
|
translation_y: -h,
|
||||||
|
duration,
|
||||||
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||||
onComplete: () => this._hideLockScreenComplete(),
|
onComplete: () => this._hideLockScreenComplete(),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -447,9 +427,6 @@ var ScreenShield = class {
|
|||||||
if (this._lockScreenState != MessageTray.State.HIDDEN)
|
if (this._lockScreenState != MessageTray.State.HIDDEN)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._lockDialogGroup.scale_x = 1;
|
|
||||||
this._lockDialogGroup.scale_y = 1;
|
|
||||||
|
|
||||||
this._lockScreenGroup.show();
|
this._lockScreenGroup.show();
|
||||||
this._lockScreenState = MessageTray.State.SHOWING;
|
this._lockScreenState = MessageTray.State.SHOWING;
|
||||||
|
|
||||||
@ -462,6 +439,14 @@ var ScreenShield = class {
|
|||||||
translation_y: 0,
|
translation_y: 0,
|
||||||
duration: MANUAL_FADE_TIME,
|
duration: MANUAL_FADE_TIME,
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||||
|
});
|
||||||
|
|
||||||
|
this._lockDialogGroup.translation_y = -global.screen_height;
|
||||||
|
this._lockDialogGroup.remove_all_transitions();
|
||||||
|
this._lockDialogGroup.ease({
|
||||||
|
translation_y: 0,
|
||||||
|
duration: Overview.ANIMATION_TIME,
|
||||||
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
this._lockScreenShown({ fadeToBlack, animateFade: true });
|
this._lockScreenShown({ fadeToBlack, animateFade: true });
|
||||||
},
|
},
|
||||||
@ -566,9 +551,8 @@ var ScreenShield = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._lockDialogGroup.ease({
|
this._lockDialogGroup.ease({
|
||||||
scale_x: 0,
|
translation_y: -global.screen_height,
|
||||||
scale_y: 0,
|
duration: Overview.ANIMATION_TIME,
|
||||||
duration: animate ? Overview.ANIMATION_TIME : 0,
|
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||||
onComplete: () => this._completeDeactivate(),
|
onComplete: () => this._completeDeactivate(),
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user