From 9afcda59dba5787817b50a74c254ccb790549e3c Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Tue, 23 Oct 2018 12:22:51 +0100 Subject: swaybar: exit on display error --- swaybar/bar.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swaybar/bar.c b/swaybar/bar.c index 1439a11c..3661c637 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c @@ -419,7 +419,10 @@ void bar_run(struct swaybar *bar) { status_in, bar); } while (1) { - wl_display_flush(bar->display); + errno = 0; + if (wl_display_flush(bar->display) == -1 && errno != EAGAIN) { + break; + } loop_poll(bar->eventloop); } } -- cgit v1.2.3