[gnome-shell] screenShield: Remove bump on key press
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] screenShield: Remove bump on key press
- Date: Mon, 11 Mar 2013 19:08:38 +0000 (UTC)
commit 67615a0cbc295d85af7d97a6709fe60c2e8cc0ff
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Nov 5 15:38:50 2012 -0500
screenShield: Remove bump on key press
Any key press of a character-emitting key will now raise the shell.
Note that the key press will not be forwarded to the entry yet.
https://bugzilla.gnome.org/show_bug.cgi?id=686740
js/ui/screenShield.js | 35 +++++------------------------------
1 files changed, 5 insertions(+), 30 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index e01d181..4081219 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -39,11 +39,6 @@ const N_ARROWS = 3;
const ARROW_ANIMATION_TIME = 0.6;
const ARROW_ANIMATION_PEAK_OPACITY = 0.4;
-// The distance in px that the lock screen will move to when pressing
-// a key that has no effect in the lock screen (bumping it)
-const BUMP_SIZE = 25;
-const BUMP_TIME = 0.3;
-
const SUMMARY_ICON_SIZE = 48;
// ScreenShield animation time
@@ -592,26 +587,21 @@ const ScreenShield = new Lang.Class({
_onLockScreenKeyPress: function(actor, event) {
let symbol = event.get_key_symbol();
+ let unichar = event.get_key_unicode();
// Do nothing if the lock screen is not fully shown.
// This avoids reusing the previous (and stale) unlock
// dialog if esc is pressed while the curtain is going
// down after cancel.
- // Similarly, don't bump if the lock screen is not showing or is
- // animating, as the bump overrides the animation and would
- // remove any onComplete handler.
if (this._lockScreenState != MessageTray.State.SHOWN)
return false;
- if (symbol == Clutter.KEY_Escape ||
- symbol == Clutter.KEY_Return ||
- symbol == Clutter.KEY_KP_Enter) {
- this._liftShield(false, 0);
- return true;
- }
+ if (!(GLib.unichar_isprint(unichar) || symbol == Clutter.KEY_Escape))
+ return false;
- this._bumpLockScreen();
+ this._ensureUnlockDialog(true, true);
+ this._liftShield(true, 0);
return true;
},
@@ -849,21 +839,6 @@ const ScreenShield = new Lang.Class({
this._hideLockScreen(false, 0);
},
- _bumpLockScreen: function() {
- Tweener.removeTweens(this._lockScreenGroup);
- Tweener.addTween(this._lockScreenGroup,
- { y: -BUMP_SIZE,
- time: BUMP_TIME / 2,
- transition: 'easeOutQuad',
- onComplete: function() {
- Tweener.addTween(this,
- { y: 0,
- time: BUMP_TIME / 2,
- transition: 'easeInQuad' });
- }
- });
- },
-
_hideLockScreenComplete: function() {
if (Main.sessionMode.currentMode == 'lock-screen')
Main.sessionMode.popMode('lock-screen');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]