summaryrefslogtreecommitdiff
path: root/x-placement-manager.c
diff options
context:
space:
mode:
authorPatrick Haller <patrick@haller.ws>2011-03-07 09:36:43 +0800
committerPatrick Haller <patrick@haller.ws>2011-03-07 09:36:43 +0800
commit1cca9c6938b1d77b3ea2f851d0a47f0d9156f2c2 (patch)
treef3eef48221a5bfd2398f277098fb34bf1a4b7229 /x-placement-manager.c
parenta31fead128bb52aabe33fde5446c625811f23b3a (diff)
converted all to c99 pedantic
Diffstat (limited to 'x-placement-manager.c')
-rw-r--r--x-placement-manager.c30
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);
}