diff options
author | Simon Ser <contact@emersion.fr> | 2021-07-08 13:17:15 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-07-26 16:58:28 +0200 |
commit | daf9ad1af73a0358fdabc29ca5817511c16e15a4 (patch) | |
tree | 4a3ece9aa85083efc31fbb3de01af4702b7f86d7 /swaybar | |
parent | a71bbdd3220540b56848f10739ccb2226e2b8f97 (diff) |
swaybar: log Wayland display errors
Diffstat (limited to 'swaybar')
-rw-r--r-- | swaybar/bar.c | 8 |
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; } } |