From 32c7386b0f3dcd9f0138164ce597e34f79cdd1b9 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 6 Sep 2018 08:29:44 +1000 Subject: 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. --- sway/input/keyboard.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sway/input/keyboard.c') 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) { raw_modifiers, false, input_inhibited); if (binding_pressed) { - seat_execute_command(seat, binding_pressed); - handled = true; - if ((binding_pressed->flags & BINDING_RELOAD) == 0) { next_repeat_binding = binding_pressed; } + seat_execute_command(seat, binding_pressed); + handled = true; } } -- cgit v1.2.3