diff options
author | Zandr Martin <zandrmartin+git@gmail.com> | 2016-05-26 08:41:22 -0500 |
---|---|---|
committer | Zandr Martin <zandrmartin+git@gmail.com> | 2016-05-26 08:41:22 -0500 |
commit | 06e06f9af2132cda9c26a2464486393e0ea76e28 (patch) | |
tree | 10e60af2771a32e372c07885bf1908e74e08e245 /swaylock | |
parent | ac4213a136ef2783782143186d174f7e17dbd0cb (diff) |
clear swaylock password buffer with esc
for i3lock compatibility
Diffstat (limited to 'swaylock')
-rw-r--r-- | swaylock/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/swaylock/main.c b/swaylock/main.c index 96e3ec29..666e59d2 100644 --- a/swaylock/main.c +++ b/swaylock/main.c @@ -162,11 +162,12 @@ void notify_key(enum wl_keyboard_key_state state, xkb_keysym_t sym, uint32_t cod // don't draw screen on modifier keys break; } + case XKB_KEY_Escape: // fallthrough case XKB_KEY_u: // fallthrough case XKB_KEY_U: { - // clear password buffer on ctrl-u - if (xkb_state_mod_name_is_active(registry->input->xkb.state, + // clear password buffer on ctrl-u (or escape for i3lock compatibility) + if (sym == XKB_KEY_Escape || xkb_state_mod_name_is_active(registry->input->xkb.state, XKB_MOD_NAME_CTRL, XKB_STATE_MODS_EFFECTIVE) > 0) { render_data.auth_state = AUTH_STATE_BACKSPACE; redraw_screen = 1; |