Revert "[awesome] Remove the two level event loops"

This reverts commit 88c9671ab1.

Conflicts:

	awesome.c

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-05-21 15:28:39 +02:00
parent 932ef459b8
commit 3c6f9a8fa0
1 changed files with 22 additions and 4 deletions

View File

@ -511,13 +511,31 @@ main(int argc, char **argv)
if(dbusfd >= 0 && FD_ISSET(dbusfd, &rd))
a_dbus_process_requests(&dbusfd);
/* two level XPending:
* we need to first check we have XEvent 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 XPending() again.
*/
while((ev = xcb_poll_for_event(globalconf.connection)))
{
xcb_handle_event(globalconf.evenths, ev);
p_delete(&ev);
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)));
statusbar_refresh(NULL);
layout_refresh(NULL);
/* need to resync */
xcb_aux_sync(globalconf.connection);
}
statusbar_refresh(NULL);
layout_refresh(NULL);
xcb_aux_sync(globalconf.connection);
}