diff options
author | Anselm R. Garbe <arg@suckless.org> | 2007-02-19 15:23:35 +0100 |
---|---|---|
committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-19 15:23:35 +0100 |
commit | e9c49ddd7a021e99dc2e7518736211ab5bc8cf2c (patch) | |
tree | 53a1e310410111719d254fc84b3461bf9f83e80a /main.c | |
parent | f8415019d4edc1cd4f310adb256e6656e85bfe75 (diff) |
removed procevent, more refactoring
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -379,6 +379,7 @@ main(int argc, char *argv[]) { char *p; int r, xfd; fd_set rd; + XEvent ev; if(argc == 2 && !strncmp("-v", argv[1], 3)) { fputs("dwm-"VERSION", (C)opyright MMVI-MMVII Anselm R. Garbe\n", stdout); @@ -411,7 +412,6 @@ main(int argc, char *argv[]) { /* main event loop, also reads status text from stdin */ XSync(dpy, False); - procevent(); readin = True; while(running) { FD_ZERO(&rd); @@ -443,7 +443,11 @@ main(int argc, char *argv[]) { drawstatus(); } if(FD_ISSET(xfd, &rd)) - procevent(); + while(XPending(dpy)) { + XNextEvent(dpy, &ev); + if(handler[ev.type]) + (handler[ev.type])(&ev); /* call handler */ + } } cleanup(); XCloseDisplay(dpy); |