diff options
| author | Dana Jansens <danakj@orodu.net> | 2010-04-28 12:57:51 -0400 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2010-04-28 12:58:42 -0400 |
| commit | 55b84316bb699fa530efe78d75ae8e1d57c1b57f (patch) | |
| tree | 4991974287c7adfdea0680b5d96d42a01c40a97a /openbox/screen.c | |
| parent | 029628087fa0090e7c3b1598786a1bf1712e0db9 (diff) | |
make an event queue for X events. the queue's min size is 16 XEvents (~3k)
Diffstat (limited to 'openbox/screen.c')
| -rw-r--r-- | openbox/screen.c | 11 |
1 files changed, 7 insertions, 4 deletions
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; |
