summaryrefslogtreecommitdiff
path: root/openbox/window.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2010-04-28 12:57:51 -0400
committerDana Jansens <danakj@orodu.net>2010-04-28 12:58:42 -0400
commit55b84316bb699fa530efe78d75ae8e1d57c1b57f (patch)
tree4991974287c7adfdea0680b5d96d42a01c40a97a /openbox/window.c
parent029628087fa0090e7c3b1598786a1bf1712e0db9 (diff)
make an event queue for X events. the queue's min size is 16 XEvents (~3k)
Diffstat (limited to 'openbox/window.c')
-rw-r--r--openbox/window.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/openbox/window.c b/openbox/window.c
index c8cb348c..ad61294d 100644
--- a/openbox/window.c
+++ b/openbox/window.c
@@ -26,6 +26,7 @@
#include "prompt.h"
#include "debug.h"
#include "grab.h"
+#include "obt/xqueue.h"
static GHashTable *window_map;
@@ -146,16 +147,15 @@ void window_manage_all(void)
if (children) XFree(children);
}
-static Bool check_unmap(Display *d, XEvent *e, XPointer arg)
+static gboolean check_unmap(XEvent *e, gpointer data)
{
- const Window win = *(Window*)arg;
+ const Window win = *(Window*)data;
return ((e->type == DestroyNotify && e->xdestroywindow.window == win) ||
(e->type == UnmapNotify && e->xunmap.window == win));
}
void window_manage(Window win)
{
- XEvent e;
XWindowAttributes attrib;
gboolean no_manage = FALSE;
gboolean is_dockapp = FALSE;
@@ -165,12 +165,11 @@ void window_manage(Window win)
/* check if it has already been unmapped by the time we started
mapping. the grab does a sync so we don't have to here */
- if (XCheckIfEvent(obt_display, &e, check_unmap, (XPointer)&win)) {
+ if (xqueue_exists_local(check_unmap, &win)) {
ob_debug("Trying to manage unmapped window. Aborting that.");
no_manage = TRUE;
}
-
- if (!XGetWindowAttributes(obt_display, win, &attrib))
+ else if (!XGetWindowAttributes(obt_display, win, &attrib))
no_manage = TRUE;
else {
XWMHints *wmhints;