From 5e3e968d2f67548318cbd7ca2293eaa26725b0f6 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 5 Aug 2008 15:37:41 +0200 Subject: [PATCH] rewrite two levels polling Signed-off-by: Julien Danjou --- awesome.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/awesome.c b/awesome.c index e2b42fb6..a90e12db 100644 --- a/awesome.c +++ b/awesome.c @@ -151,6 +151,7 @@ a_xcb_check_cb(EV_P_ ev_check *w, int revents) { xcb_generic_event_t *ev; +xev_restart: while((ev = xcb_poll_for_event(globalconf.connection))) { xcb_handle_event(globalconf.evenths, ev); @@ -162,6 +163,10 @@ a_xcb_check_cb(EV_P_ ev_check *w, int revents) titlebar_refresh(); xcb_aux_sync(globalconf.connection); + + /* synchronize can wake up X and pull new events in the queue */ + if((ev = xcb_poll_for_event(globalconf.connection))) + goto xev_restart; } static void