aboutsummaryrefslogtreecommitdiff
path: root/swaybar/bar.c
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar/bar.c')
-rw-r--r--swaybar/bar.c18
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);
}
}