diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2015-12-18 17:43:03 +0100 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2015-12-18 18:27:44 +0100 |
commit | ede27eabc53dc926aa1932c2a58c06def1000f86 (patch) | |
tree | 4d734e99a6163d846423c79a2d7ff04070018e78 /sway/container.c | |
parent | swaybar: ipc_update_ws: Fix memory corruption. (diff) | |
download | sway-ede27eabc53dc926aa1932c2a58c06def1000f86.tar.gz sway-ede27eabc53dc926aa1932c2a58c06def1000f86.tar.zst sway-ede27eabc53dc926aa1932c2a58c06def1000f86.zip |
Reload swaybar/swaybg on config reload.
This works by tracking the pids of the child processes in the related
output container and terminating the processes and spawning new ones on
a config reload.
Should solve: #347
Diffstat (limited to 'sway/container.c')
-rw-r--r-- | sway/container.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/container.c b/sway/container.c index 36056ff7..395eb04d 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -60,6 +60,9 @@ static void free_swayc(swayc_t *cont) { | |||
60 | if (cont->app_id) { | 60 | if (cont->app_id) { |
61 | free(cont->app_id); | 61 | free(cont->app_id); |
62 | } | 62 | } |
63 | if (cont->bar_pids) { | ||
64 | free_flat_list(cont->bar_pids); | ||
65 | } | ||
63 | free(cont); | 66 | free(cont); |
64 | } | 67 | } |
65 | 68 | ||
@@ -109,6 +112,8 @@ swayc_t *new_output(wlc_handle handle) { | |||
109 | output->width = size->w; | 112 | output->width = size->w; |
110 | output->height = size->h; | 113 | output->height = size->h; |
111 | output->unmanaged = create_list(); | 114 | output->unmanaged = create_list(); |
115 | output->bar_pids = create_list(); | ||
116 | output->bg_pid = 0; | ||
112 | 117 | ||
113 | apply_output_config(oc, output); | 118 | apply_output_config(oc, output); |
114 | add_child(&root_container, output); | 119 | add_child(&root_container, output); |