summaryrefslogtreecommitdiff
path: root/x-focus-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'x-focus-manager.c')
-rw-r--r--x-focus-manager.c29
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);
}