swaybar: exit cleanly when disconnected from IPC

This commit is contained in:
Simon Ser 2021-07-08 13:16:11 +02:00
parent 2e03a61262
commit a71bbdd322

View file

@ -468,6 +468,13 @@ static void display_in(int fd, short mask, void *data) {
static void ipc_in(int fd, short mask, void *data) {
struct swaybar *bar = data;
if (mask & (POLLHUP | POLLERR)) {
if (mask & POLLERR) {
sway_log(SWAY_ERROR, "IPC poll error");
}
bar->running = false;
return;
}
if (handle_ipc_readable(bar)) {
set_bar_dirty(bar);
}