aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/keyboard.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-04 20:00:04 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-04 20:00:04 +1000
commit7797490e9e285589f501e46202df36b6bf8afcfd (patch)
tree9e581c403ef8b99df78bddb7e54be856ada4514e /sway/input/keyboard.c
parentMerge pull request #2561 from RyanDwyer/window-role-criteria (diff)
downloadsway-7797490e9e285589f501e46202df36b6bf8afcfd.tar.gz
sway-7797490e9e285589f501e46202df36b6bf8afcfd.tar.zst
sway-7797490e9e285589f501e46202df36b6bf8afcfd.zip
Deny repeating reload by holding key
Fixes #2568 The binding that gets stored in the keyboard's `repeat_binding` would get freed on reload, leaving a dangling pointer. Rather than attempt to unset the keyboard's `repeat_binding` along with the other bindings, I opted to just not set it for the reload command because there's no point in reloading repeatedly by holding the binding. This disables repeat bindings for the reload command. As we now need to detect whether it's a reload command in two places, I've added a binding flag to track whether it's a reload or not.
Diffstat (limited to 'sway/input/keyboard.c')
-rw-r--r--sway/input/keyboard.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 160ef10b..0d2a62b5 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -280,7 +280,10 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) {
280 if (binding_pressed) { 280 if (binding_pressed) {
281 seat_execute_command(seat, binding_pressed); 281 seat_execute_command(seat, binding_pressed);
282 handled = true; 282 handled = true;
283 next_repeat_binding = binding_pressed; 283
284 if ((binding_pressed->flags & BINDING_RELOAD) == 0) {
285 next_repeat_binding = binding_pressed;
286 }
284 } 287 }
285 } 288 }
286 289