From 0ea4ce49808b673986ff16b804ade4ec6663ab2b Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 5 Aug 2008 15:11:43 +0200 Subject: [PATCH] remove two levels polling Signed-off-by: Julien Danjou --- awesome.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/awesome.c b/awesome.c index d0b472c6..e2b42fb6 100644 --- a/awesome.c +++ b/awesome.c @@ -151,33 +151,16 @@ a_xcb_check_cb(EV_P_ ev_check *w, int revents) { xcb_generic_event_t *ev; - /* Two level polling: - * We need to first check we have an event to handle - * and if so, we handle them all in a round. - * Then when we have refresh()'ed stuff so maybe new XEvent - * are available and select() won't tell us, so let's check - * with xcb_poll_for_event() again. - */ while((ev = xcb_poll_for_event(globalconf.connection))) { - do - { - xcb_handle_event(globalconf.evenths, ev); - /* need to resync */ - xcb_aux_sync(globalconf.connection); - p_delete(&ev); - } while((ev = xcb_poll_for_event(globalconf.connection))); - - layout_refresh(); - statusbar_refresh(); - titlebar_refresh(); - - /* need to resync */ - xcb_aux_sync(globalconf.connection); + xcb_handle_event(globalconf.evenths, ev); + p_delete(&ev); } + layout_refresh(); statusbar_refresh(); titlebar_refresh(); + xcb_aux_sync(globalconf.connection); }