X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=obt%2Fmainloop.c;h=753662569013c66d14bd95e58c19340b9646f05e;hb=b025a0268f302df78589d3cc36aad5f56693799f;hp=ecdd7f7f535fdfafeb265884dbb79cf5ca32dbfb;hpb=d179d6428ae585a3b8a13479bfe4586e41de2ff9;p=chaz%2Fopenbox diff --git a/obt/mainloop.c b/obt/mainloop.c index ecdd7f7f..75366256 100644 --- a/obt/mainloop.c +++ b/obt/mainloop.c @@ -19,6 +19,7 @@ #include "obt/mainloop.h" #include "obt/display.h" +#include "obt/xqueue.h" #include "obt/util.h" #ifdef HAVE_STDIO_H @@ -296,10 +297,8 @@ void obt_main_loop_run(ObtMainLoop *loop) loop->signal_fired = FALSE; sigprocmask(SIG_SETMASK, &oldset, NULL); - } else if (loop->display && XPending(loop->display)) { - do { - XNextEvent(loop->display, &e); - + } else if (loop->display && xqueue_pending_local()) { + while (xqueue_next_local(&e) && loop->run) { if (e.type == MappingNotify) XRefreshKeyboardMapping(&e.xmapping); @@ -307,10 +306,9 @@ void obt_main_loop_run(ObtMainLoop *loop) ObtMainLoopXHandlerType *h = it->data; h->func(&e, h->data); } - } while (XPending(loop->display) && loop->run); + } } else { /* this only runs if there were no x events received */ - timer_dispatch(loop, (GTimeVal**)&wait); selset = loop->fd_set;