aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-11-26 19:43:06 -0500
committerLibravatar Simon Ser <contact@emersion.fr>2019-11-27 02:04:13 +0100
commit1a5797803a48fb71515e6bd6335d684a6cae6b6d (patch)
tree528f75121271960a271709f495a75754916ee42f /sway/config.c
parentinput/keyboard: check keyboard group before remove (diff)
downloadsway-1a5797803a48fb71515e6bd6335d684a6cae6b6d.tar.gz
sway-1a5797803a48fb71515e6bd6335d684a6cae6b6d.tar.zst
sway-1a5797803a48fb71515e6bd6335d684a6cae6b6d.zip
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.
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/sway/config.c b/sway/config.c
index 1f03610a..553cba2b 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -447,15 +447,17 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
447 old_config->xwayland ? "enabled" : "disabled"); 447 old_config->xwayland ? "enabled" : "disabled");
448 config->xwayland = old_config->xwayland; 448 config->xwayland = old_config->xwayland;
449 449
450 if (old_config->swaybg_client != NULL) { 450 if (!config->validating) {
451 wl_client_destroy(old_config->swaybg_client); 451 if (old_config->swaybg_client != NULL) {
452 } 452 wl_client_destroy(old_config->swaybg_client);
453 }
453 454
454 if (old_config->swaynag_config_errors.client != NULL) { 455 if (old_config->swaynag_config_errors.client != NULL) {
455 wl_client_destroy(old_config->swaynag_config_errors.client); 456 wl_client_destroy(old_config->swaynag_config_errors.client);
456 } 457 }
457 458
458 input_manager_reset_all_inputs(); 459 input_manager_reset_all_inputs();
460 }
459 } 461 }
460 462
461 config->current_config_path = path; 463 config->current_config_path = path;
@@ -520,8 +522,13 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
520 return success; 522 return success;
521 } 523 }
522 524
523 if (is_active) { 525 if (is_active && !validating) {
524 input_manager_verify_fallback_seat(); 526 input_manager_verify_fallback_seat();
527
528 for (int i = 0; i < config->input_configs->length; i++) {
529 input_manager_apply_input_config(config->input_configs->items[i]);
530 }
531
525 for (int i = 0; i < config->seat_configs->length; i++) { 532 for (int i = 0; i < config->seat_configs->length; i++) {
526 input_manager_apply_seat_config(config->seat_configs->items[i]); 533 input_manager_apply_seat_config(config->seat_configs->items[i]);
527 } 534 }