diff options
author | Brian Ashworth <[email protected]> | 2019-06-11 21:41:02 -0400 |
---|---|---|
committer | Simon Ser <[email protected]> | 2019-06-12 07:56:41 +0300 |
commit | 9670ccee683ab985e89eb04302fb998c4161f2d6 (patch) | |
tree | f7cafeaf55a7c139e97a920b0b43bcb080d3a27c /sway/config.c | |
parent | 2b5bf78fafdf027624ca88e1f703bc9e577f4690 (diff) |
bindings: defer while initiailizing
This adds the logic to defer binding execution while sway is still
initializing. Without this, the binding command would be executed, but
the command handler would return CMD_DEFER, which was being treated as
a failure to run. To avoid partial executions, this will defer all
bindings while config->active is false.
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c index 4f92b403..4e64bd3a 100644 --- a/sway/config.c +++ b/sway/config.c @@ -644,7 +644,23 @@ void run_deferred_commands(void) { list_free(res_list); free(line); } - transaction_commit_dirty(); +} + +void run_deferred_bindings(void) { + struct sway_seat *seat; + wl_list_for_each(seat, &(server.input->seats), link) { + if (!seat->deferred_bindings->length) { + continue; + } + sway_log(SWAY_DEBUG, "Running deferred bindings for seat %s", + seat->wlr_seat->name); + while (seat->deferred_bindings->length) { + struct sway_binding *binding = seat->deferred_bindings->items[0]; + seat_execute_command(seat, binding); + list_del(seat->deferred_bindings, 0); + free_sway_binding(binding); + } + } } // get line, with backslash continuation |