diff options
Diffstat (limited to 'x-placement-manager.c')
| -rw-r--r-- | x-placement-manager.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/x-placement-manager.c b/x-placement-manager.c index f51e7f2..2cd51b5 100644 --- a/x-placement-manager.c +++ b/x-placement-manager.c @@ -1,7 +1,3 @@ -#include <errno.h> -#include <stdio.h> -#include <stdarg.h> -#include <stdlib.h> #include <X11/Xlib.h> #include <X11/Xproto.h> #include <X11/cursorfont.h> @@ -9,7 +5,6 @@ /* place all clients in the center */ - void place_center(Display *d, XEvent *e); static void (*handler[LASTEvent]) (Display *d, XEvent *) = { @@ -43,28 +38,6 @@ place_center(Display *d, XEvent *e) { } int -interruptibleXNextEvent(Display *dpy, XEvent *event) { - fd_set fds; - int rc; - int dpy_fd = ConnectionNumber(dpy); - for (;;) { - if (XPending(dpy)) { - XNextEvent(dpy, event); - return 1; - } - FD_ZERO(&fds); - FD_SET(dpy_fd, &fds); - rc = select(dpy_fd + 1, &fds, NULL, NULL, NULL); - if (rc < 0) { - if (errno == EINTR) { - return 0; - } - // LOG_ERROR("interruptibleXNextEvent(): select()\n"); - } - } -} - -int main(int argc, char **argv) { Display *dpy; XEvent e; @@ -78,8 +51,7 @@ main(int argc, char **argv) { XChangeWindowAttributes(dpy, DefaultRootWindow(dpy) , CWEventMask|CWCursor, &wa); for(;;) { - if (! interruptibleXNextEvent(dpy, &e)) - continue; + XNextEvent(dpy, &e); if(handler[e.type]) handler[e.type](dpy, &e); } |
