From 15603c25cf00a11dbdf238203858d9eab313120c Mon Sep 17 00:00:00 2001 From: Bert Date: Mon, 17 Jan 2011 18:32:28 +0100 Subject: Added event loop --- events.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'events.c') diff --git a/events.c b/events.c index 54121ea..ccc5f2e 100644 --- a/events.c +++ b/events.c @@ -22,6 +22,7 @@ #include #include "events.h" +#include "window.h" extern Display *dpy; @@ -55,4 +56,10 @@ static void (*handler[LASTEvent])(app_t*, XEvent*) = { }; void event_loop(app_t *app) { + XEvent ev; + + while (!XNextEvent(dpy, &ev)) { + if (handler[ev.type]) + handler[ev.type](app, &ev); + } } -- cgit v1.2.3