aboutsummaryrefslogtreecommitdiff
path: root/src/safe_x11/safex11.c
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@openmailbox.org>2015-11-22 20:02:10 -0300
committerMatias Linares <matiaslina@openmailbox.org>2015-11-22 20:02:10 -0300
commit83b7d0cb4f30c95ce6f27d2c0944727d75eb6e5e (patch)
tree255c9e3f5e0703676382fda1157bdb5daf14bc62 /src/safe_x11/safex11.c
parent47fc031feeddc955e6c7c43410613c75e3370e96 (diff)
downloaddotwm-83b7d0cb4f30c95ce6f27d2c0944727d75eb6e5e.tar.gz
Death to the threads.
All the socket stuff is done syncing it with select calls so we can get either a X11 event or a Socket event. Also cleanup the C mess, it's done all in rust now :).
Diffstat (limited to 'src/safe_x11/safex11.c')
-rw-r--r--src/safe_x11/safex11.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/safe_x11/safex11.c b/src/safe_x11/safex11.c
deleted file mode 100644
index e4f87d8..0000000
--- a/src/safe_x11/safex11.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "safex11.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <X11/Xutil.h>
-
-int select_next_event(Display *display, int x11_fd, XEvent *retval)
-{
- fd_set in_fds;
- struct timeval tv;
- XEvent ev;
- /* check if there're some events on the queue first of all. */
- if(XPending(display) > 0)
- goto EVENT_QUEUED;
-
- FD_ZERO(&in_fds);
- FD_SET(x11_fd, &in_fds);
-
- /* one second */
- tv.tv_usec = 0;
- tv.tv_sec = 1;
-
- /* Wait for X Event or a Timer */
- if(select(x11_fd+1, &in_fds, 0, 0, &tv))
- goto EVENT_QUEUED;
-
- return 0;
-
-EVENT_QUEUED:
- XNextEvent(display, &ev);
- *retval = ev;
- return 1;
-}