From b25a73c24392c98d75d5aa17ff08d08ae60fbea7 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Tue, 15 Oct 2019 21:34:35 +0200 Subject: [PATCH] authPrompt: Wiggle on failure Add a wiggle effect to the password entry on failure. The parameters are set as per design review during GNOME Shell Hackfest 2019. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/768 --- js/gdm/authPrompt.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js index 93a381056..5300c4318 100644 --- a/js/gdm/authPrompt.js +++ b/js/gdm/authPrompt.js @@ -6,6 +6,7 @@ const { Clutter, GObject, Pango, Shell, St } = imports.gi; const Animation = imports.ui.animation; const Batch = imports.gdm.batch; const GdmUtil = imports.gdm.util; +const Util = imports.misc.util; const Params = imports.misc.params; const ShellEntry = imports.ui.shellEntry; const UserWidget = imports.ui.userWidget; @@ -16,6 +17,10 @@ var DEFAULT_BUTTON_WELL_ANIMATION_TIME = 300; var MESSAGE_FADE_OUT_ANIMATION_TIME = 500; +const WIGGLE_OFFSET = 6; +const WIGGLE_DURATION = 65; +const N_WIGGLES = 3; + var AuthPromptMode = { UNLOCK_ONLY: 0, UNLOCK_OR_LOG_IN: 1 @@ -256,6 +261,12 @@ var AuthPrompt = GObject.registerClass({ this.updateSensitivity(canRetry); this.setActorInDefaultButtonWell(null); this.verificationStatus = AuthPromptStatus.VERIFICATION_FAILED; + + Util.wiggle(this._entry, { + offset: WIGGLE_OFFSET, + duration: WIGGLE_DURATION, + wiggleCount: N_WIGGLES, + }); } _onVerificationComplete() {