diff options
| author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-13 16:04:37 +1000 |
|---|---|---|
| committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-15 00:26:27 +1000 |
| commit | 4056c09e13c1aeead6dd4085fc7e263a17a0b195 (patch) | |
| tree | a3413f2a5717968e370d68521b689580d5adc5a0 /swaybar/status_line.c | |
| parent | 7f2e6d812a36e6c30623871c4640897593f6a6cd (diff) | |
Move swaybar's event loop to common directory and refactor
* The loop functions are now prefixed with `loop_`.
* It is now easy to add timers to the loop.
* Timers are implemented using pollfd and timerfd, rather than manually
checking them when any other event happens to arrive.
Diffstat (limited to 'swaybar/status_line.c')
| -rw-r--r-- | swaybar/status_line.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/swaybar/status_line.c b/swaybar/status_line.c index 000609ce..3f7a386f 100644 --- a/swaybar/status_line.c +++ b/swaybar/status_line.c @@ -7,16 +7,16 @@ #include <stdio.h> #include <unistd.h> #include <wlr/util/log.h> +#include "loop.h" #include "swaybar/bar.h" #include "swaybar/config.h" #include "swaybar/i3bar.h" -#include "swaybar/event_loop.h" #include "swaybar/status_line.h" #include "readline.h" static void status_line_close_fds(struct status_line *status) { if (status->read_fd != -1) { - remove_event(status->read_fd); + loop_remove_event(status->bar->eventloop, status->bar->status_event); close(status->read_fd); status->read_fd = -1; } |
