aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/keyboard.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-06 08:29:44 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-06 08:33:00 +1000
commit32c7386b0f3dcd9f0138164ce597e34f79cdd1b9 (patch)
tree0df99ee8d973003a2889f81e6e6963430cdeb13f /sway/input/keyboard.c
parentMerge pull request #2572 from RedSoxFan/wlr-output-disabling (diff)
downloadsway-32c7386b0f3dcd9f0138164ce597e34f79cdd1b9.tar.gz
sway-32c7386b0f3dcd9f0138164ce597e34f79cdd1b9.tar.zst
sway-32c7386b0f3dcd9f0138164ce597e34f79cdd1b9.zip
Fix management of bindings during reload
seat_execute_command needs to check the flags on `binding_copy`, as `binding` will be a dangling pointer after a reload command. handle_keyboard_key needs to set the next_repeat_binding for non-reloads prior to executing the command in case the binding is freed by the reload command.
Diffstat (limited to 'sway/input/keyboard.c')
-rw-r--r--sway/input/keyboard.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 0d2a62b5..a74229f5 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -278,12 +278,11 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) {
278 raw_modifiers, false, input_inhibited); 278 raw_modifiers, false, input_inhibited);
279 279
280 if (binding_pressed) { 280 if (binding_pressed) {
281 seat_execute_command(seat, binding_pressed);
282 handled = true;
283
284 if ((binding_pressed->flags & BINDING_RELOAD) == 0) { 281 if ((binding_pressed->flags & BINDING_RELOAD) == 0) {
285 next_repeat_binding = binding_pressed; 282 next_repeat_binding = binding_pressed;
286 } 283 }
284 seat_execute_command(seat, binding_pressed);
285 handled = true;
287 } 286 }
288 } 287 }
289 288