diff options
| author | Patrick Haller <patrick@haller.ws> | 2011-03-07 09:36:43 +0800 |
|---|---|---|
| committer | Patrick Haller <patrick@haller.ws> | 2011-03-07 09:36:43 +0800 |
| commit | 1cca9c6938b1d77b3ea2f851d0a47f0d9156f2c2 (patch) | |
| tree | f3eef48221a5bfd2398f277098fb34bf1a4b7229 /x-focus-manager.c | |
| parent | a31fead128bb52aabe33fde5446c625811f23b3a (diff) | |
converted all to c99 pedantic
Diffstat (limited to 'x-focus-manager.c')
| -rw-r--r-- | x-focus-manager.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/x-focus-manager.c b/x-focus-manager.c index 69c9e96..5ebba4e 100644 --- a/x-focus-manager.c +++ b/x-focus-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> @@ -29,28 +25,6 @@ reset_focus(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; @@ -64,8 +38,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); } |
