aboutsummaryrefslogtreecommitdiff
path: root/swaybar
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar')
-rw-r--r--swaybar/bar.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c
index 2b11065f..15eab782 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -461,7 +461,15 @@ bool bar_setup(struct swaybar *bar, const char *socket_path) {
static void display_in(int fd, short mask, void *data) {
struct swaybar *bar = data;
+ if (mask & (POLLHUP | POLLERR)) {
+ if (mask & POLLERR) {
+ sway_log(SWAY_ERROR, "Wayland display poll error");
+ }
+ bar->running = false;
+ return;
+ }
if (wl_display_dispatch(bar->display) == -1) {
+ sway_log(SWAY_ERROR, "wl_display_dispatch failed");
bar->running = false;
}
}