diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2024-10-08 01:14:37 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2024-10-08 01:31:31 -0700 |
commit | 644f0d1e8ee044f05ea530b58479820152f4e545 (patch) | |
tree | 12670ba4b49804250a64699613262701d3469f8b | |
parent | 56f1ddab1bcd223e3175980c4fdda36c37016afe (diff) |
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.
-rw-r--r-- | src/vwm.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -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))); |