From daf9ad1af73a0358fdabc29ca5817511c16e15a4 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 8 Jul 2021 13:17:15 +0200 Subject: swaybar: log Wayland display errors --- swaybar/bar.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'swaybar') 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; } } -- cgit v1.2.3