X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/d180ba418cd56f3a743d9a5863f86f7eae21602f..352cae4380713949d3800ebcda7aff3bb5ab9efc:/main.c

diff --git a/main.c b/main.c
index 73b713f..d06a1b3 100644
--- a/main.c
+++ b/main.c
@@ -21,7 +21,6 @@ char stext[256];
 int screen, sx, sy, sw, sh, wax, way, waw, wah;
 unsigned int bh, ntags, numlockmask;
 Atom wmatom[WMLast], netatom[NetLast];
-Bool running = True;
 Bool *seltag;
 Bool selscreen = True;
 Client *clients = NULL;
@@ -36,6 +35,7 @@ Window root, barwin;
 
 static int (*xerrorxlib)(Display *, XErrorEvent *);
 static Bool otherwm, readin;
+static Bool running = True;
 
 static void
 cleanup(void) {
@@ -236,7 +236,7 @@ sendevent(Window w, Atom a, long value) {
 }
 
 void
-quit(Arg *arg) {
+quit(Arg arg) {
 	readin = running = False;
 }
 
@@ -325,12 +325,11 @@ main(int argc, char *argv[]) {
 			}
 			drawstatus();
 		}
-		if(FD_ISSET(xfd, &rd))
-			while(XPending(dpy)) {
-				XNextEvent(dpy, &ev);
-				if(handler[ev.type])
-					(handler[ev.type])(&ev); /* call handler */
-			}
+		while(XPending(dpy)) {
+			XNextEvent(dpy, &ev);
+			if(handler[ev.type])
+				(handler[ev.type])(&ev); /* call handler */
+		}
 	}
 	cleanup();
 	XCloseDisplay(dpy);