aboutsummaryrefslogtreecommitdiffstats
path: root/swaylock
diff options
context:
space:
mode:
authorLibravatar Zandr Martin <zandrmartin+git@gmail.com>2016-05-26 08:35:16 -0500
committerLibravatar Zandr Martin <zandrmartin+git@gmail.com>2016-05-26 08:35:16 -0500
commitac4213a136ef2783782143186d174f7e17dbd0cb (patch)
tree819731e164a21da4d432d7769995b4c31f213456 /swaylock
parentMerge pull request #671 from zandrmartin/fullscreen-focus (diff)
downloadsway-ac4213a136ef2783782143186d174f7e17dbd0cb.tar.gz
sway-ac4213a136ef2783782143186d174f7e17dbd0cb.tar.zst
sway-ac4213a136ef2783782143186d174f7e17dbd0cb.zip
clear password buffer with ctrl-u in swaylock
also prevent screen redraws on modifier key presses
Diffstat (limited to 'swaylock')
-rw-r--r--swaylock/main.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/swaylock/main.c b/swaylock/main.c
index 777bca09..96e3ec29 100644
--- a/swaylock/main.c
+++ b/swaylock/main.c
@@ -144,6 +144,40 @@ void notify_key(enum wl_keyboard_key_state state, xkb_keysym_t sym, uint32_t cod
144 } 144 }
145 break; 145 break;
146 } 146 }
147 case XKB_KEY_Control_L: // fallthrough
148 case XKB_KEY_Control_R: // fallthrough
149 case XKB_KEY_Shift_L: // fallthrough
150 case XKB_KEY_Shift_R: // fallthrough
151 case XKB_KEY_Caps_Lock: // fallthrough
152 case XKB_KEY_Shift_Lock: // fallthrough
153 case XKB_KEY_Meta_L: // fallthrough
154 case XKB_KEY_Meta_R: // fallthrough
155 case XKB_KEY_Alt_L: // fallthrough
156 case XKB_KEY_Alt_R: // fallthrough
157 case XKB_KEY_Super_L: // fallthrough
158 case XKB_KEY_Super_R: // fallthrough
159 case XKB_KEY_Hyper_L: // fallthrough
160 case XKB_KEY_Hyper_R: // fallthrough
161 {
162 // don't draw screen on modifier keys
163 break;
164 }
165 case XKB_KEY_u: // fallthrough
166 case XKB_KEY_U:
167 {
168 // clear password buffer on ctrl-u
169 if (xkb_state_mod_name_is_active(registry->input->xkb.state,
170 XKB_MOD_NAME_CTRL, XKB_STATE_MODS_EFFECTIVE) > 0) {
171 render_data.auth_state = AUTH_STATE_BACKSPACE;
172 redraw_screen = 1;
173
174 password_size = 1024;
175 free(password);
176 password = malloc(password_size);
177 password[0] = '\0';
178 break;
179 }
180 }
147 default: 181 default:
148 { 182 {
149 render_data.auth_state = AUTH_STATE_INPUT; 183 render_data.auth_state = AUTH_STATE_INPUT;