From 55b84316bb699fa530efe78d75ae8e1d57c1b57f Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 28 Apr 2010 12:57:51 -0400 Subject: make an event queue for X events. the queue's min size is 16 XEvents (~3k) --- openbox/screen.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'openbox/screen.c') diff --git a/openbox/screen.c b/openbox/screen.c index 2ff950ab..5246d341 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -36,6 +36,7 @@ #include "obrender/render.h" #include "gettext.h" #include "obt/display.h" +#include "obt/xqueue.h" #include "obt/prop.h" #include "obt/mainloop.h" @@ -129,14 +130,16 @@ static gboolean replace_wm(void) /* Wait for old window manager to go away */ if (current_wm_sn_owner) { - XEvent event; gulong wait = 0; const gulong timeout = G_USEC_PER_SEC * 15; /* wait for 15s max */ + ObtXQueueWindowType wt; + + wt.window = current_wm_sn_owner; + wt.type = DestroyNotify; while (wait < timeout) { - if (XCheckWindowEvent(obt_display, current_wm_sn_owner, - StructureNotifyMask, &event) && - event.type == DestroyNotify) + /* Checks the local queue and incoming events for this event */ + if (xqueue_exists_local(xqueue_match_window_type, &wt)) break; g_usleep(G_USEC_PER_SEC / 10); wait += G_USEC_PER_SEC / 10; -- cgit v1.2.3