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 | clear password buffer with ctrl-u in swaylock (diff) | |
download | sway-06e06f9af2132cda9c26a2464486393e0ea76e28.tar.gz sway-06e06f9af2132cda9c26a2464486393e0ea76e28.tar.zst sway-06e06f9af2132cda9c26a2464486393e0ea76e28.zip |
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 | |||
162 | // don't draw screen on modifier keys | 162 | // don't draw screen on modifier keys |
163 | break; | 163 | break; |
164 | } | 164 | } |
165 | case XKB_KEY_Escape: // fallthrough | ||
165 | case XKB_KEY_u: // fallthrough | 166 | case XKB_KEY_u: // fallthrough |
166 | case XKB_KEY_U: | 167 | case XKB_KEY_U: |
167 | { | 168 | { |
168 | // clear password buffer on ctrl-u | 169 | // clear password buffer on ctrl-u (or escape for i3lock compatibility) |
169 | if (xkb_state_mod_name_is_active(registry->input->xkb.state, | 170 | if (sym == XKB_KEY_Escape || xkb_state_mod_name_is_active(registry->input->xkb.state, |
170 | XKB_MOD_NAME_CTRL, XKB_STATE_MODS_EFFECTIVE) > 0) { | 171 | XKB_MOD_NAME_CTRL, XKB_STATE_MODS_EFFECTIVE) > 0) { |
171 | render_data.auth_state = AUTH_STATE_BACKSPACE; | 172 | render_data.auth_state = AUTH_STATE_BACKSPACE; |
172 | redraw_screen = 1; | 173 | redraw_screen = 1; |