diff options
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index e0acebea..693e11eb 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -347,11 +347,14 @@ static bool handle_bindsym(struct sway_binding *binding) { | |||
347 | } | 347 | } |
348 | 348 | ||
349 | if (match) { | 349 | if (match) { |
350 | struct sway_binding *binding_copy = sway_binding_dup(binding); | ||
350 | struct cmd_results *res = handle_command(binding->command); | 351 | struct cmd_results *res = handle_command(binding->command); |
351 | if (res->status != CMD_SUCCESS) { | 352 | if (res->status != CMD_SUCCESS) { |
352 | sway_log(L_ERROR, "Command '%s' failed: %s", res->input, res->error); | 353 | sway_log(L_ERROR, "Command '%s' failed: %s", res->input, res->error); |
353 | } | 354 | } |
355 | ipc_event_binding_keyboard(binding_copy); | ||
354 | free_cmd_results(res); | 356 | free_cmd_results(res); |
357 | free_sway_binding(binding_copy); | ||
355 | return true; | 358 | return true; |
356 | } | 359 | } |
357 | 360 | ||
@@ -362,11 +365,14 @@ static bool handle_bindsym_release(struct sway_binding *binding) { | |||
362 | if (binding->keys->length == 1) { | 365 | if (binding->keys->length == 1) { |
363 | xkb_keysym_t *key = binding->keys->items[0]; | 366 | xkb_keysym_t *key = binding->keys->items[0]; |
364 | if (check_released_key(*key)) { | 367 | if (check_released_key(*key)) { |
368 | struct sway_binding *binding_copy = sway_binding_dup(binding); | ||
365 | struct cmd_results *res = handle_command(binding->command); | 369 | struct cmd_results *res = handle_command(binding->command); |
366 | if (res->status != CMD_SUCCESS) { | 370 | if (res->status != CMD_SUCCESS) { |
367 | sway_log(L_ERROR, "Command '%s' failed: %s", res->input, res->error); | 371 | sway_log(L_ERROR, "Command '%s' failed: %s", res->input, res->error); |
368 | } | 372 | } |
373 | ipc_event_binding_keyboard(binding_copy); | ||
369 | free_cmd_results(res); | 374 | free_cmd_results(res); |
375 | free_sway_binding(binding_copy); | ||
370 | return true; | 376 | return true; |
371 | } | 377 | } |
372 | } | 378 | } |