[hackers] [wmii] Add printevent.c and -V (verbose) flag to print X events

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri Feb 09 18:47:55 2007

changeset: 1807:a3d3dfff5780
user: Kris Maglione <jg_AT_suckless.org>
date: Fri Feb 09 12:45:52 2007 -0500
summary: Add printevent.c and -V (verbose) flag to print X events

diff -r 2648ffbc0006 -r a3d3dfff5780 Makefile
--- a/Makefile Fri Feb 09 12:25:35 2007 -0500
+++ b/Makefile Fri Feb 09 12:45:52 2007 -0500
@@ -4,7 +4,8 @@ include config.mk
 include config.mk
 
 SRC = area.c bar.c client.c column.c draw.c event.c \
- frame.c fs.c geom.c key.c main.c mouse.c rule.c view.c
+ frame.c fs.c geom.c key.c main.c mouse.c rule.c view.c \
+ printevent.c
 OBJ = ${SRC:.c=.o}
 
 all: options wmiiwm
diff -r 2648ffbc0006 -r a3d3dfff5780 event.c
--- a/event.c Fri Feb 09 12:25:35 2007 -0500
+++ b/event.c Fri Feb 09 12:45:52 2007 -0500
@@ -6,6 +6,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <X11/keysym.h>
+#include "printevent.h"
 
 unsigned int
 flush_masked_events(long even_mask) {
@@ -282,6 +283,8 @@ check_x_event(IXPConn *c) {
         XEvent ev;
         while(XPending(blz.dpy)) { /* main event loop */
                 XNextEvent(blz.dpy, &ev);
+ if(verbose)
+ printevent(&ev);
                 if(handler[ev.type])
                         (handler[ev.type]) (&ev); /* call handler */
         }
diff -r 2648ffbc0006 -r a3d3dfff5780 main.c
--- a/main.c Fri Feb 09 12:25:35 2007 -0500
+++ b/main.c Fri Feb 09 12:45:52 2007 -0500
@@ -19,7 +19,9 @@
 #include <X11/Xatom.h>
 #include <X11/Xproto.h>
 
-Bool check_other_wm;
+Bool verbose;
+Bool starting;
+static Bool check_other_wm;
 static int (*x_error_handler) (Display *, XErrorEvent *);
 static char version[] = "wmiiwm - " VERSION ", (C)opyright MMIV-MMVI Anselm R. Garbe\n";
 
@@ -199,6 +201,9 @@ main(int argc, char *argv[]) {
                 case 'v':
                         fprintf(stdout, "%s", version);
                         exit(0);
+ break;
+ case 'V':
+ verbose = True;
                         break;
                 case 'a':
                         if(i + 1 < argc)
diff -r 2648ffbc0006 -r a3d3dfff5780 wmii.h
--- a/wmii.h Fri Feb 09 12:25:35 2007 -0500
+++ b/wmii.h Fri Feb 09 12:45:52 2007 -0500
@@ -239,7 +239,8 @@ void (*handler[LASTEvent]) (XEvent *);
 void (*handler[LASTEvent]) (XEvent *);
 
 /* Misc */
-Bool starting;
+extern Bool starting;
+extern Bool verbose;
 
 /* wm.c */
 extern char *message_root(char *message);
Received on Fri Feb 09 2007 - 18:47:55 UTC

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