From 75e7bd24ccb9731065bb7f8313aa53ba11ddc420 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Wed, 3 Apr 2019 21:53:43 -0400 Subject: swaybg: one instance for all outputs This makes it so there will only be one swaybg instance running instead of one per output. swaybg's cli has been changed to a xrandr like interface, where you select an output and then change properties for that output and then select another output and repeat. This also makes it so swaybg is only killed and respawned when a background changes or when reloading. --- sway/config.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sway/config.c') diff --git a/sway/config.c b/sway/config.c index 7104f55d..d5bfe105 100644 --- a/sway/config.c +++ b/sway/config.c @@ -104,6 +104,9 @@ void free_config(struct sway_config *config) { } list_free(config->output_configs); } + if (config->swaybg_client != NULL) { + wl_client_destroy(config->swaybg_client); + } if (config->input_configs) { for (int i = 0; i < config->input_configs->length; i++) { free_input_config(config->input_configs->items[i]); @@ -480,6 +483,7 @@ bool load_main_config(const char *file, bool is_active, bool validating) { if (is_active) { reset_outputs(); + spawn_swaybg(); config->reloading = false; if (config->swaynag_config_errors.pid > 0) { -- cgit v1.2.3-54-g00ecf