aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/bar.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-14 12:28:38 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-15 00:26:27 +1000
commit6921fdc6d6134fd7aaf38ffc1686623eca9bbd18 (patch)
tree0cbafde1d61ba4282e3ca73b4a312b9e82db25f9 /swaybar/bar.c
parentswaylock: Don't wait too long for surface damage before verifying (diff)
downloadsway-6921fdc6d6134fd7aaf38ffc1686623eca9bbd18.tar.gz
sway-6921fdc6d6134fd7aaf38ffc1686623eca9bbd18.tar.zst
sway-6921fdc6d6134fd7aaf38ffc1686623eca9bbd18.zip
Remove timerfd from loop implementation
timerfd doesn't work on the BSDs, so this replaces it with a timespec for the expiry and uses a poll timeout to check the timers when needed.
Diffstat (limited to 'swaybar/bar.c')
-rw-r--r--swaybar/bar.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c
index 8e89c9a8..be290c18 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -647,7 +647,7 @@ static void status_in(int fd, short mask, void *data) {
647 if (mask & (POLLHUP | POLLERR)) { 647 if (mask & (POLLHUP | POLLERR)) {
648 status_error(bar->status, "[error reading from status command]"); 648 status_error(bar->status, "[error reading from status command]");
649 set_bar_dirty(bar); 649 set_bar_dirty(bar);
650 loop_remove_event(bar->eventloop, bar->status_event); 650 loop_remove_fd(bar->eventloop, fd);
651 } else if (status_handle_readable(bar->status)) { 651 } else if (status_handle_readable(bar->status)) {
652 set_bar_dirty(bar); 652 set_bar_dirty(bar);
653 } 653 }
@@ -658,8 +658,8 @@ void bar_run(struct swaybar *bar) {
658 display_in, bar); 658 display_in, bar);
659 loop_add_fd(bar->eventloop, bar->ipc_event_socketfd, POLLIN, ipc_in, bar); 659 loop_add_fd(bar->eventloop, bar->ipc_event_socketfd, POLLIN, ipc_in, bar);
660 if (bar->status) { 660 if (bar->status) {
661 bar->status_event = loop_add_fd( 661 loop_add_fd(bar->eventloop, bar->status->read_fd, POLLIN,
662 bar->eventloop, bar->status->read_fd, POLLIN, status_in, bar); 662 status_in, bar);
663 } 663 }
664 while (1) { 664 while (1) {
665 wl_display_flush(bar->display); 665 wl_display_flush(bar->display);