diff options
Diffstat (limited to 'sway/commands/bind.c')
-rw-r--r-- | sway/commands/bind.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c index d43c87fb..49b511ad 100644 --- a/sway/commands/bind.c +++ b/sway/commands/bind.c | |||
@@ -559,8 +559,20 @@ struct cmd_results *cmd_unbindswitch(int argc, char **argv) { | |||
559 | * Execute the command associated to a binding | 559 | * Execute the command associated to a binding |
560 | */ | 560 | */ |
561 | void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding) { | 561 | void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding) { |
562 | sway_log(SWAY_DEBUG, "running command for binding: %s", binding->command); | 562 | if (!config->active) { |
563 | sway_log(SWAY_DEBUG, "deferring command for binding: %s", | ||
564 | binding->command); | ||
565 | struct sway_binding *deferred = calloc(1, sizeof(struct sway_binding)); | ||
566 | if (!deferred) { | ||
567 | sway_log(SWAY_ERROR, "Failed to allocate deferred binding"); | ||
568 | return; | ||
569 | } | ||
570 | memcpy(deferred, binding, sizeof(struct sway_binding)); | ||
571 | list_add(seat->deferred_bindings, deferred); | ||
572 | return; | ||
573 | } | ||
563 | 574 | ||
575 | sway_log(SWAY_DEBUG, "running command for binding: %s", binding->command); | ||
564 | struct sway_container *con = NULL; | 576 | struct sway_container *con = NULL; |
565 | if (binding->type == BINDING_MOUSESYM | 577 | if (binding->type == BINDING_MOUSESYM |
566 | || binding->type == BINDING_MOUSECODE) { | 578 | || binding->type == BINDING_MOUSECODE) { |