Permalink
Browse files

* integrated a change from Simon Engelsman (thanks!):

	* XNextEvent() was replaced by interruptible_XNextEvent() function in do_event_loop()
  • Loading branch information...
1 parent 35f015f commit b57d268558c416fc2e21009c2fc447e28fe2ac56 @nickgravgaard committed Apr 4, 2010
Showing with 58 additions and 12 deletions.
  1. +6 −0 CHANGELOG
  2. +1 −1 client.c
  3. +42 −2 events.c
  4. +1 −1 main.c
  5. +1 −1 manage.c
  6. +1 −1 menufile.c
  7. +1 −1 misc.c
  8. +1 −1 new.c
  9. +1 −1 taskbar.c
  10. +3 −3 windowlab.h
View
@@ -1,3 +1,9 @@
+1.40 (2010-04-04)
+
+* integrated a change from Simon Engelsman (thanks!):
+ * XNextEvent() was replaced by interruptible_XNextEvent() function in do_event_loop()
+
+
1.39 (2009-12-27)
* integrated more changes from Mats Erik Andersson:
View
@@ -1,5 +1,5 @@
/* WindowLab - an X11 window manager
- * Copyright (c) 2001-2009 Nick Gravgaard
+ * Copyright (c) 2001-2010 Nick Gravgaard
* me at nickgravgaard.com
* http://nickgravgaard.com/windowlab/
*
View
@@ -1,5 +1,5 @@
/* WindowLab - an X11 window manager
- * Copyright (c) 2001-2009 Nick Gravgaard
+ * Copyright (c) 2001-2010 Nick Gravgaard
* me at nickgravgaard.com
* http://nickgravgaard.com/windowlab/
*
@@ -39,6 +39,8 @@ static void handle_expose_event(XExposeEvent *);
static void handle_shape_change(XShapeEvent *);
#endif
+static int interruptible_XNextEvent(XEvent *event);
+
/* We may want to put in some sort of check for unknown events at some
* point. TWM has an interesting and different way of doing this... */
@@ -48,7 +50,7 @@ void do_event_loop(void)
for (;;)
{
- XNextEvent(dsply, &ev);
+ interruptible_XNextEvent(&ev);
#ifdef DEBUG
show_event(ev);
#endif
@@ -616,3 +618,41 @@ static void handle_shape_change(XShapeEvent *e)
}
}
#endif
+
+/* interruptibleXNextEvent() was originally taken from Blender's source code
+ * and came with the following copyright notice: */
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996. */
+
+/* This program is freely distributable without licensing fees
+ * and is provided without guarantee or warrantee expressed or
+ * implied. This program is -not- in the public domain. */
+
+/* Unlike XNextEvent, if a signal arrives, interruptibleXNextEvent will
+ * return zero. */
+
+static int interruptible_XNextEvent(XEvent *event)
+{
+ fd_set fds;
+ int rc;
+ int dsply_fd = ConnectionNumber(dsply);
+ for (;;)
+ {
+ if (XPending(dsply))
+ {
+ XNextEvent(dsply, event);
+ return 1;
+ }
+ FD_ZERO(&fds);
+ FD_SET(dsply_fd, &fds);
+ rc = select(dsply_fd + 1, &fds, NULL, NULL, NULL);
+ if (rc < 0)
+ {
+ if (errno == EINTR)
+ {
+ return 0;
+ }
+ return 1;
+ }
+ }
+}
View
@@ -1,5 +1,5 @@
/* WindowLab - an X11 window manager
- * Copyright (c) 2001-2009 Nick Gravgaard
+ * Copyright (c) 2001-2010 Nick Gravgaard
* me at nickgravgaard.com
* http://nickgravgaard.com/windowlab/
*
View
@@ -1,5 +1,5 @@
/* WindowLab - an X11 window manager
- * Copyright (c) 2001-2009 Nick Gravgaard
+ * Copyright (c) 2001-2010 Nick Gravgaard
* me at nickgravgaard.com
* http://nickgravgaard.com/windowlab/
*
View
@@ -1,5 +1,5 @@
/* WindowLab - an X11 window manager
- * Copyright (c) 2001-2009 Nick Gravgaard
+ * Copyright (c) 2001-2010 Nick Gravgaard
* me at nickgravgaard.com
* http://nickgravgaard.com/windowlab/
*
View
@@ -1,5 +1,5 @@
/* WindowLab - an X11 window manager
- * Copyright (c) 2001-2009 Nick Gravgaard
+ * Copyright (c) 2001-2010 Nick Gravgaard
* me at nickgravgaard.com
* http://nickgravgaard.com/windowlab/
*
View
@@ -1,5 +1,5 @@
/* WindowLab - an X11 window manager
- * Copyright (c) 2001-2009 Nick Gravgaard
+ * Copyright (c) 2001-2010 Nick Gravgaard
* me at nickgravgaard.com
* http://nickgravgaard.com/windowlab/
*
View
@@ -1,5 +1,5 @@
/* WindowLab - an X11 window manager
- * Copyright (c) 2001-2009 Nick Gravgaard
+ * Copyright (c) 2001-2010 Nick Gravgaard
* me at nickgravgaard.com
* http://nickgravgaard.com/windowlab/
*
View
@@ -1,5 +1,5 @@
/* WindowLab - an X11 window manager
- * Copyright (c) 2001-2009 Nick Gravgaard
+ * Copyright (c) 2001-2010 Nick Gravgaard
* me at nickgravgaard.com
* http://nickgravgaard.com/windowlab/
*
@@ -21,8 +21,8 @@
#ifndef WINDOWLAB_H
#define WINDOWLAB_H
-#define VERSION "1.39"
-#define RELEASEDATE "2009-12-27"
+#define VERSION "1.40"
+#define RELEASEDATE "2010-04-04"
#include <errno.h>
#include <limits.h>

0 comments on commit b57d268

Please sign in to comment.