commit 2e84f21ab786a5e31de836fda4e8bbd6de08d0ec
parent 2719ddfe5e171881f3997f9f853bfca97fe01529
Author: Drew DeVault <sir@cmpwn.com>
Date: Thu, 29 Mar 2018 18:08:23 -0400
Terminate swaybar when freeing bar config
Diffstat:
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/sway/config/bar.c b/sway/config/bar.c
@@ -15,6 +15,16 @@
#include "list.h"
#include "log.h"
+static void terminate_swaybar(pid_t pid) {
+ int ret = kill(pid, SIGTERM);
+ if (ret != 0) {
+ wlr_log_errno(L_ERROR, "Unable to terminate swaybar %d", pid);
+ } else {
+ int status;
+ waitpid(pid, &status, 0);
+ }
+}
+
void free_bar_config(struct bar_config *bar) {
if (!bar) {
return;
@@ -31,7 +41,7 @@ void free_bar_config(struct bar_config *bar) {
free_flat_list(bar->outputs);
}
if (bar->pid != 0) {
- // TODO terminate_swaybar(bar->pid);
+ terminate_swaybar(bar->pid);
}
free(bar->colors.background);
free(bar->colors.statusline);
@@ -191,16 +201,6 @@ void invoke_swaybar(struct bar_config *bar) {
close(filedes[1]);
}
-static void terminate_swaybar(pid_t pid) {
- int ret = kill(pid, SIGTERM);
- if (ret != 0) {
- wlr_log_errno(L_ERROR, "Unable to terminate swaybar %d", pid);
- } else {
- int status;
- waitpid(pid, &status, 0);
- }
-}
-
static bool active_output(const char *name) {
swayc_t *cont = NULL;
for (int i = 0; i < root_container.children->length; ++i) {