changeset: 42:2d0168759a1132df0ceff873104c19b08c88adc2
tag: tip
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Thu Jan 25 15:27:59 2007 +0100
files: main.c st.h
description:
added event handler variable
diff -r d19a3d570305 main.c
--- a/main.c Wed Jan 03 17:51:38 2007 +0100
+++ b/main.c Thu Jan 25 15:28:19 2007 +0100
@@ -128,6 +128,7 @@ char buffer[BUFFER_SIZE], *ptydev;
char buffer[BUFFER_SIZE], *ptydev;
int master, screen, slave;
struct winsize wsz;
+void (*handler[LASTEvent]) (XEvent *) = {0};
Display *dpy;
Fnt normal;
Fnt bold;
@@ -170,9 +171,8 @@ main(int argc, char *argv[]) {
if(FD_ISSET(xfd, &rd)) {
while(XPending(dpy)) {
XNextEvent(dpy, &ev);
- /*
if(handler[ev.type])
- (handler[ev.type])(&ev); *//* call handler */
+ (handler[ev.type])(&ev);
}
}
if(FD_ISSET(master, &rd)) {
diff -r d19a3d570305 st.h
--- a/st.h Wed Jan 03 17:51:38 2007 +0100
+++ b/st.h Thu Jan 25 15:28:19 2007 +0100
@@ -27,6 +27,7 @@ extern char buffer[BUFFER_SIZE], *ptydev
extern char buffer[BUFFER_SIZE], *ptydev;
extern int master, screen, slave;
extern struct winsize wsz;
+extern void (*handler[LASTEvent])(XEvent *); /* event handler */
extern Display *dpy;
extern Fnt normal;
extern Fnt bold;
Received on Thu Jan 25 2007 - 15:29:13 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:54:44 UTC