summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZandr Martin <zandrmartin+git@gmail.com>2016-05-26 08:41:22 -0500
committerZandr Martin <zandrmartin+git@gmail.com>2016-05-26 08:41:22 -0500
commit4911e97541c6b7378d6af7d0335a2b498912fd30 (patch)
treedc1970e062ba6f5faa0c8de360c04a3e7b994fd0
parentd0c8c394ca4fdd3b060d225073715cf134a03ae4 (diff)
clear swaylock password buffer with esc
for i3lock compatibility
-rw-r--r--main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.c b/main.c
index 96e3ec2..666e59d 100644
--- a/main.c
+++ b/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;