mirror of
https://github.com/swaywm/sway.git
synced 2026-04-21 06:46:22 -04:00
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.
This commit is contained in:
parent
2b5bf78faf
commit
9670ccee68
6 changed files with 47 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue