aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-01-09 00:57:23 -0500
committerBrian Ashworth <bosrsf04@gmail.com>2019-01-09 01:06:21 -0500
commitf33969358c77ea440677a97b4f9a5fb2013ca5ea (patch)
tree7840ff5e7d8573440c2b0386709d60fd5b1306f3
parentda8f24de1d3d5843142be1164919ca6a49155ae9 (diff)
downloadsway-f33969358c77ea440677a97b4f9a5fb2013ca5ea.tar.xz
reload: apply seat cfgs after reading entire cfg
Wait until all seat configs have been read before applying them on reload. This prevents unnecessary attachment/detachment of input devices and therefore creation/destruction of seat devices as individual lines are read.
-rw-r--r--sway/commands/seat.c4
-rw-r--r--sway/config.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/sway/commands/seat.c b/sway/commands/seat.c
index 3e7ffed9..b8db862b 100644
--- a/sway/commands/seat.c
+++ b/sway/commands/seat.c
@@ -35,7 +35,9 @@ struct cmd_results *cmd_seat(int argc, char **argv) {
struct seat_config *sc =
store_seat_config(config->handler_context.seat_config);
- input_manager_apply_seat_config(sc);
+ if (!config->reading) {
+ input_manager_apply_seat_config(sc);
+ }
config->handler_context.seat_config = NULL;
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/config.c b/sway/config.c
index 8a0b293c..dfbe4cb9 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -463,7 +463,11 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
if (config->swaynag_config_errors.pid > 0) {
swaynag_show(&config->swaynag_config_errors);
}
+
input_manager_verify_fallback_seat();
+ for (int i = 0; i < config->seat_configs->length; i++) {
+ input_manager_apply_seat_config(config->seat_configs->items[i]);
+ }
}
if (old_config) {