mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-21 11:55:42 +02:00
bar: detect XCB disconnect (and abort)
This commit is contained in:
parent
400a92fa04
commit
3f226d8cce
1 changed files with 6 additions and 0 deletions
6
bar.c
6
bar.c
|
@ -597,6 +597,12 @@ run(struct bar_run_context *run_ctx)
|
||||||
if (fds[0].revents && POLLIN)
|
if (fds[0].revents && POLLIN)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (fds[1].revents & POLLHUP) {
|
||||||
|
LOG_WARN("disconnected from XCB");
|
||||||
|
write(run_ctx->abort_fd, &(uint64_t){1}, sizeof(uint64_t));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for (xcb_generic_event_t *e = xcb_wait_for_event(bar->conn);
|
for (xcb_generic_event_t *e = xcb_wait_for_event(bar->conn);
|
||||||
e != NULL;
|
e != NULL;
|
||||||
e = xcb_poll_for_event(bar->conn))
|
e = xcb_poll_for_event(bar->conn))
|
||||||
|
|
Loading…
Add table
Reference in a new issue