From 1a5797803a48fb71515e6bd6335d684a6cae6b6d Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Tue, 26 Nov 2019 19:43:06 -0500 Subject: config: improvements to the reload validation For the validation pass of reloading, there is no need to touch swaybg, swaynag, inputs, outputs, or seats. This drastically improves the speed of a reload by skipping over the expensive I/O configuration and handling of wayland clients. As long as the syntax is valid, the CMD_FAILURE's can be relayed during the actual reload. --- sway/commands/input.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'sway/commands/input.c') diff --git a/sway/commands/input.c b/sway/commands/input.c index a11ad79a..53db9a16 100644 --- a/sway/commands/input.c +++ b/sway/commands/input.c @@ -44,23 +44,6 @@ static struct cmd_handler input_config_handlers[] = { { "xkb_numlock", input_cmd_xkb_numlock }, }; -/** - * Re-translate keysyms if a change in the input config could affect them. - */ -static void retranslate_keysyms(struct input_config *input_config) { - for (int i = 0; i < config->input_configs->length; ++i) { - struct input_config *ic = config->input_configs->items[i]; - if (ic->xkb_layout || ic->xkb_file) { - // this is the first config with xkb_layout or xkb_file - if (ic->identifier == input_config->identifier) { - translate_keysyms(ic); - } - - return; - } - } -} - struct cmd_results *cmd_input(int argc, char **argv) { struct cmd_results *error = NULL; if ((error = checkarg(argc, "input", EXPECTED_AT_LEAST, 2))) { @@ -106,8 +89,9 @@ struct cmd_results *cmd_input(int argc, char **argv) { return res; } - input_manager_apply_input_config(ic); - retranslate_keysyms(ic); + if (!config->reloading) { + input_manager_apply_input_config(ic); + } } else { free_input_config(config->handler_context.input_config); } -- cgit v1.2.3-54-g00ecf