mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-26 21:58:08 +01:00
Remove status command event on error
This prevents very high CPU load when the status command dies, and poll continuously awoken with POLLHUP.
This commit is contained in:
parent
9a3fb33e33
commit
2ebb6073b7
1 changed files with 5 additions and 1 deletions
|
@ -418,7 +418,11 @@ static void ipc_in(int fd, short mask, void *_bar) {
|
|||
|
||||
static void status_in(int fd, short mask, void *_bar) {
|
||||
struct swaybar *bar = (struct swaybar *)_bar;
|
||||
if (status_handle_readable(bar->status)) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue