about summary refs log tree commit diff stats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.c b/main.c
index 77ce0df..3453b59 100644
--- a/main.c
+++ b/main.c
@@ -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);
8' href='#n138'>138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170