X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fopenbox;a=blobdiff_plain;f=openbox%2Fscreen.c;h=5246d341ed22462bdbf55e778ff6058ee4eacd29;hp=2ff950ab6e5da36071715c75d31c16ea2cece39e;hb=55b84316bb699fa530efe78d75ae8e1d57c1b57f;hpb=029628087fa0090e7c3b1598786a1bf1712e0db9 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;