swaybar: log Wayland display errors

This commit is contained in:
Simon Ser 2021-07-08 13:17:15 +02:00
parent a71bbdd322
commit daf9ad1af7
1 changed files with 8 additions and 0 deletions

View File

@ -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;
}
}