From 644f0d1e8ee044f05ea530b58479820152f4e545 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 8 Oct 2024 01:14:37 -0700 Subject: vwm: ms->us poll timeout transition Switch to using vcr_backend_poll() like everything else which will do the right thing about handling delay_us. --- src/vwm.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/vwm.c b/src/vwm.c index 449106c..ac1baac 100644 --- a/src/vwm.c +++ b/src/vwm.c @@ -321,18 +321,13 @@ void vwm_process_event(vwm_t *vwm) int main(int argc, char *argv[]) { - vwm_t *vwm; - struct pollfd pfd; + vwm_t *vwm; if (!(vwm = vwm_startup())) { VWM_ERROR("Unable to startup vwm"); goto _err; } - pfd.events = POLLIN; - pfd.revents = 0; - pfd.fd = ConnectionNumber(VWM_XDISPLAY(vwm)); - while (!vwm->done) { do { int delay_us; @@ -340,10 +335,8 @@ int main(int argc, char *argv[]) if (vwm_charts_update(vwm->charts, &delay_us)) vwm_composite_repaint_needed(vwm); - if (!XPending(VWM_XDISPLAY(vwm))) { - if (poll(&pfd, 1, delay_us) == 0) - break; - } + if (vcr_backend_poll(vwm->vcr_backend, delay_us) == 0) + break; vwm_process_event(vwm); } while (QLength(VWM_XDISPLAY(vwm))); -- cgit v1.2.3