From 75d07b3dde0946c167800083c9f322bf3769b5c9 Mon Sep 17 00:00:00 2001 From: Daniel Hirt Date: Fri, 20 Mar 2015 15:15:50 -0400 Subject: [PATCH] lokker: update caps-lock hint even on "checking" state Summary: This fixes the inconsistency in the "Caps Lock is On" hint, if you press Caps-Lock when lokker is busy with checking the password (LOKKER_STATE_CHECKING). Test Plan: 1. Lock the screen 2. Enter invalid password (and press Enter) 3. During password check, press Caps-Lock The "Caps-Lock is On" should be consistent with the actual Caps-Lock state. @fix Reviewers: zmike Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2171 --- src/modules/lokker/lokker.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/modules/lokker/lokker.c b/src/modules/lokker/lokker.c index 8cc8289d2..fdc75178d 100644 --- a/src/modules/lokker/lokker.c +++ b/src/modules/lokker/lokker.c @@ -671,6 +671,15 @@ _lokker_cb_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) { Ecore_Event_Key *ev = event; + if (!strcmp(ev->key, "Caps_Lock")) + { + if(ev->modifiers & ECORE_EVENT_LOCK_CAPS) + _lokker_caps_hint_update(""); + else + _lokker_caps_hint_update(_("Caps Lock is On")); + return (edd->state != LOKKER_STATE_CHECKING); + } + if (edd->state == LOKKER_STATE_CHECKING) return ECORE_CALLBACK_DONE; if (!strcmp(ev->key, "Escape")) @@ -705,13 +714,6 @@ _lokker_cb_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) } _lokker_delete(); } - else if (!strcmp(ev->key, "Caps_Lock")) - { - if(ev->modifiers & ECORE_EVENT_LOCK_CAPS) - _lokker_caps_hint_update(""); - else - _lokker_caps_hint_update(_("Caps Lock is On")); - } else if ((!strcmp(ev->key, "u") && (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL))) _lokker_null();