diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2018-02-04 10:37:46 -0700 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2018-02-04 10:37:46 -0700 |
| commit | 102b33b36b2b00a95da65e486629e428d31dc166 (patch) | |
| tree | ab10cd02219ad353a97794139e92e8801ce5871f /include | |
| parent | ad9523c734c64c03057e988d20a8cb264c06f19d (diff) | |
Handle swaybar status line errors
The event loop API was redesigned to avoid race conditions as well.
Fixes #1583
Diffstat (limited to 'include')
| -rw-r--r-- | include/swaybar/event_loop.h | 8 | ||||
| -rw-r--r-- | include/swaybar/status_line.h | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/include/swaybar/event_loop.h b/include/swaybar/event_loop.h index a0cde07f..d5089262 100644 --- a/include/swaybar/event_loop.h +++ b/include/swaybar/event_loop.h @@ -13,11 +13,11 @@ void add_timer(timer_t timer, void(*cb)(timer_t timer, void *data), void *data); -// Returns false if nothing exists, true otherwise -bool remove_event(int fd); +// Remove the given event from the event loop +void remove_event(int fd); -// Returns false if nothing exists, true otherwise -bool remove_timer(timer_t timer); +// Remove the given timer from the event loop +void remove_timer(timer_t timer); // Blocks and returns after sending callbacks void event_loop_poll(); diff --git a/include/swaybar/status_line.h b/include/swaybar/status_line.h index 0664ddee..3ec0fcd0 100644 --- a/include/swaybar/status_line.h +++ b/include/swaybar/status_line.h @@ -49,6 +49,12 @@ struct status_line *init_status_line(); bool handle_status_line(struct bar *bar); /** + * This should be called if statusline input cannot be accessed. + * It will set an error statusline instead of using the status command + */ +void handle_status_hup(struct status_line *status); + +/** * Handle mouse clicks. */ bool status_line_mouse_event(struct bar *bar, int x, int y, uint32_t button); |
