diff options
Diffstat (limited to 'src/test.c')
-rw-r--r-- | src/test.c | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -13,27 +13,27 @@ print_event(XEvent *e) break; case ReparentNotify: printf("got ReparentNotify event: window %d\n", - e->xmap.window); + e->xreparent.window); break; case MotionNotify: printf("got MotionNotify event: window %d\n", - e->xmap.window); + e->xmotion.window); break; case ButtonPress: printf("got ButtonPress event: window %d\n", - e->xmap.window); + e->xbutton.window); break; case ButtonRelease: printf("got ButtonRelease event: window %d\n", - e->xmap.window); + e->xbutton.window); break; case EnterNotify: printf("got EnterNotify event: window %d\n", - e->xmap.window); + e->xcrossing.window); break; case LeaveNotify: printf("got LeaveaNotify event: window %d\n", - e->xmap.window); + e->xcrossing.window); break; default: printf("got event type %d\n", e->type); @@ -42,16 +42,17 @@ print_event(XEvent *e) } static void -wait_for(Display *display, int type) +run(Display *display) { XEvent e; while (1) { XNextEvent(display, &e); print_event(&e); - if (e.type == MapNotify) + switch (e.type) { + case ButtonPress: break; - + } } } @@ -81,9 +82,7 @@ int main(int argc, char *argv[]) XMapWindow(display, win); XFlush(display); - wait_for(display, MapNotify); - - wait_for(display, MapNotify); + run(display); XCloseDisplay(display); |