diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-21 14:45:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-21 14:45:33 +0200 |
commit | ce70b9c45c65ae09e2d093520683ba77730d3368 (patch) | |
tree | f57dd4468446b9f07e55657912ff7843e7451ab3 /swaybar/bar.c | |
parent | 7d43cedc95a76cc4d466f76f0023383abd6ddab0 (diff) | |
parent | c63554885e4aae4e1c8f97ffbd53160f3eb99510 (diff) | |
download | sway-ce70b9c45c65ae09e2d093520683ba77730d3368.tar.xz |
Merge pull request #1835 from ascent12/swaybar_status_err
Swaybar fix
Diffstat (limited to 'swaybar/bar.c')
-rw-r--r-- | swaybar/bar.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c index d51c4ec7..669cb11a 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c @@ -401,24 +401,28 @@ void bar_setup(struct swaybar *bar, render_all_frames(bar); } -static void display_in(int fd, short mask, void *_bar) { - struct swaybar *bar = (struct swaybar *)_bar; +static void display_in(int fd, short mask, void *data) { + struct swaybar *bar = data; if (wl_display_dispatch(bar->display) == -1) { bar_teardown(bar); exit(0); } } -static void ipc_in(int fd, short mask, void *_bar) { - struct swaybar *bar = (struct swaybar *)_bar; +static void ipc_in(int fd, short mask, void *data) { + struct swaybar *bar = data; if (handle_ipc_readable(bar)) { render_all_frames(bar); } } -static void status_in(int fd, short mask, void *_bar) { - struct swaybar *bar = (struct swaybar *)_bar; - if (status_handle_readable(bar->status)) { +static void status_in(int fd, short mask, void *data) { + struct swaybar *bar = data; + if (mask & (POLLHUP | POLLERR)) { + status_error(bar->status, "[error reading from status command]"); + render_all_frames(bar); + remove_event(fd); + } else if (status_handle_readable(bar->status)) { render_all_frames(bar); } } |