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
This commit is contained in:
Daniel Hirt 2015-03-20 15:15:50 -04:00 committed by Mike Blumenkrantz
parent def3ac82ae
commit 75d07b3dde
1 changed files with 9 additions and 7 deletions

View File

@ -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();