mirror of https://github.com/0intro/wmii
Add printevent.c and -V (verbose) flag to print X events
This commit is contained in:
parent
83d52792b4
commit
46a973cf85
3
Makefile
3
Makefile
|
@ -4,7 +4,8 @@
|
|||
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
|
||||
|
|
3
event.c
3
event.c
|
@ -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 */
|
||||
}
|
||||
|
|
7
main.c
7
main.c
|
@ -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";
|
||||
|
||||
|
@ -200,6 +202,9 @@ main(int argc, char *argv[]) {
|
|||
fprintf(stdout, "%s", version);
|
||||
exit(0);
|
||||
break;
|
||||
case 'V':
|
||||
verbose = True;
|
||||
break;
|
||||
case 'a':
|
||||
if(i + 1 < argc)
|
||||
address = argv[++i];
|
||||
|
|
Loading…
Reference in New Issue