From 9670ccee683ab985e89eb04302fb998c4161f2d6 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Tue, 11 Jun 2019 21:41:02 -0400 Subject: 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. --- include/sway/config.h | 5 +++++ include/sway/input/seat.h | 2 ++ 2 files changed, 7 insertions(+) (limited to 'include/sway') diff --git a/include/sway/config.h b/include/sway/config.h index 57ae3c63..9736a665 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -558,6 +558,11 @@ bool read_config(FILE *file, struct sway_config *config, */ void run_deferred_commands(void); +/** + * Run the binding commands that were deferred when initializing the inputs + */ +void run_deferred_bindings(void); + /** * Adds a warning entry to the swaynag instance used for errors. */ diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index eb6c09a1..c963de9b 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h @@ -78,6 +78,8 @@ struct sway_seat { uint32_t last_button_serial; + list_t *deferred_bindings; // struct sway_binding + struct wl_listener focus_destroy; struct wl_listener new_node; struct wl_listener request_start_drag; -- cgit v1.2.3-54-g00ecf