aboutsummaryrefslogtreecommitdiff
path: root/sway/config/bar.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-29 18:08:23 -0400
committerDrew DeVault <sir@cmpwn.com>2018-03-29 22:11:08 -0400
commit2e84f21ab786a5e31de836fda4e8bbd6de08d0ec (patch)
tree059730741e28a14cd1454fe1fd5d396beafa1696 /sway/config/bar.c
parent2719ddfe5e171881f3997f9f853bfca97fe01529 (diff)
Terminate swaybar when freeing bar config
Diffstat (limited to 'sway/config/bar.c')
-rw-r--r--sway/config/bar.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sway/config/bar.c b/sway/config/bar.c
index 5e02c01c..10abdef7 100644
--- 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) {