aboutsummaryrefslogtreecommitdiff
path: root/sway/config.c
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-05-03 23:26:18 -0400
committerSimon Ser <contact@emersion.fr>2019-05-04 09:06:43 +0300
commit51c077798cf06ebd5e27271fb5e276c181f8a077 (patch)
tree983ee70377704f1940f0f242ce89fdf472989ebe /sway/config.c
parent32087ad77d393c24360d3210b89b9a85886a8698 (diff)
Destroy swaybg client on reload
When reloading, this destroys the old config's swaybg client before spawning the new config's swaybg. This fixes a race condition where the old config's swaybg client's destroy was being called after the new config's swaybg client was being spawned. This was causing the reference to the new swaybg client to be removed and never destroyed. This also modifies handle_swaybg_client_destroy to grab the config reference using wl_container_of on the listener since the swaybg client may be the old config swaybg client and should be used instead of the global config instance
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c
index 64093aca..4f92b403 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -441,6 +441,10 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
config->reloading = true;
config->active = true;
+ if (old_config->swaybg_client != NULL) {
+ wl_client_destroy(old_config->swaybg_client);
+ }
+
if (old_config->swaynag_config_errors.client != NULL) {
wl_client_destroy(old_config->swaynag_config_errors.client);
}