[hackers] [dwm] removed procevent, more refactoring

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Mon Feb 19 15:27:54 2007

changeset: 778:2ec66bdbb8ad
tag: tip
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Mon Feb 19 15:23:35 2007 +0100
summary: removed procevent, more refactoring

diff -r 469dc170f833 -r 2ec66bdbb8ad dwm.h
--- a/dwm.h Mon Feb 19 15:17:31 2007 +0100
+++ b/dwm.h Mon Feb 19 15:23:35 2007 +0100
@@ -115,7 +115,6 @@ extern void zoom(Arg *arg); /* zooms t
 
 /* 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 */
diff -r 469dc170f833 -r 2ec66bdbb8ad event.c
--- a/event.c Mon Feb 19 15:17:31 2007 +0100
+++ b/event.c Mon Feb 19 15:23:35 2007 +0100
@@ -368,14 +368,3 @@ grabkeys(void) {
                                 GrabModeAsync, GrabModeAsync);
         }
 }
-
-void
-procevent(void) {
- XEvent ev;
-
- while(XPending(dpy)) {
- XNextEvent(dpy, &ev);
- if(handler[ev.type])
- (handler[ev.type])(&ev); /* call handler */
- }
-}
diff -r 469dc170f833 -r 2ec66bdbb8ad main.c
--- a/main.c Mon Feb 19 15:17:31 2007 +0100
+++ b/main.c Mon Feb 19 15:23:35 2007 +0100
@@ -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);
Received on Mon Feb 19 2007 - 15:27:54 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:28 UTC