/* event.c */
extern void grabkeys(void); /* grab all keys defined in config.h */
-extern void procevent(void); /* process pending X events */
/* main.c */
extern void drawstatus(void); /* draw the bar */
GrabModeAsync, GrabModeAsync);
}
}
-
-void
-procevent(void) {
- XEvent ev;
-
- while(XPending(dpy)) {
- XNextEvent(dpy, &ev);
- if(handler[ev.type])
- (handler[ev.type])(&ev); /* call handler */
- }
-}
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);
/* main event loop, also reads status text from stdin */
XSync(dpy, False);
- procevent();
readin = True;
while(running) {
FD_ZERO(&rd);
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);