[gnome-shell] ScreenShield: don't allow cancelling the curtain by pressing esc twice in the dialog
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] ScreenShield: don't allow cancelling the curtain by pressing esc twice in the dialog
- Date: Sun, 14 Oct 2012 16:48:25 +0000 (UTC)
commit 5ad7db722d1cbf42d803ae9c6989f4d9804369b9
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Wed Oct 3 23:13:25 2012 +0200
ScreenShield: don't allow cancelling the curtain by pressing esc twice in the dialog
If esc is pressed twice in succession in the unlock dialog, the curtain
is cancelled, but the dialog is cleared after the first esc cancels it,
and it's not destroyed and recreated.
https://bugzilla.gnome.org/show_bug.cgi?id=685441
js/ui/screenShield.js | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 0e5557e..4674e65 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -439,6 +439,17 @@ const ScreenShield = new Lang.Class({
_onLockScreenKeyRelease: function(actor, event) {
let symbol = event.get_key_symbol();
+ // 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) {
@@ -447,11 +458,7 @@ const ScreenShield = new Lang.Class({
return true;
}
- // 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)
- this._bumpLockScreen();
+ this._bumpLockScreen();
return true;
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]