X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fwindow.c;h=c8cb348c7cdc36950b46bed21c9675bb7907ad1b;hb=bb97a20777e74d681e5f1912f5b243f19253600b;hp=88a727dfa583589e885c62678e5ecabef61cecb3;hpb=a01ece1353465ef471becdad3e448c32a4516f43;p=chaz%2Fopenbox diff --git a/openbox/window.c b/openbox/window.c index 88a727df..c8cb348c 100644 --- a/openbox/window.c +++ b/openbox/window.c @@ -74,8 +74,11 @@ ObStackingLayer window_layer(ObWindow *self) return ((ObClient*)self)->layer; case OB_WINDOW_CLASS_MENUFRAME: case OB_WINDOW_CLASS_INTERNAL: - case OB_WINDOW_CLASS_PROMPT: return OB_STACKING_LAYER_INTERNAL; + case OB_WINDOW_CLASS_PROMPT: + /* not used directly for stacking, prompts are managed as clients */ + g_assert_not_reached(); + break; } g_assert_not_reached(); return None; @@ -143,6 +146,13 @@ void window_manage_all(void) if (children) XFree(children); } +static Bool check_unmap(Display *d, XEvent *e, XPointer arg) +{ + const Window win = *(Window*)arg; + return ((e->type == DestroyNotify && e->xdestroywindow.window == win) || + (e->type == UnmapNotify && e->xunmap.window == win)); +} + void window_manage(Window win) { XEvent e; @@ -155,11 +165,8 @@ 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 (XCheckTypedWindowEvent(obt_display, win, DestroyNotify, &e) || - XCheckTypedWindowEvent(obt_display, win, UnmapNotify, &e)) - { - XPutBackEvent(obt_display, &e); - ob_debug("Trying to manage unmapped window. Aborting that.\n"); + if (XCheckIfEvent(obt_display, &e, check_unmap, (XPointer)&win)) { + ob_debug("Trying to manage unmapped window. Aborting that."); no_manage = TRUE; } @@ -184,7 +191,7 @@ void window_manage(Window win) if (!no_manage) { if (attrib.override_redirect) { - ob_debug("not managing override redirect window 0x%x\n", win); + ob_debug("not managing override redirect window 0x%x", win); grab_server(FALSE); } else if (is_dockapp) { @@ -193,11 +200,11 @@ void window_manage(Window win) dock_manage(icon_win, win); } else - client_manage(win); + client_manage(win, NULL); } else { grab_server(FALSE); - ob_debug("FAILED to manage window 0x%x\n", win); + ob_debug("FAILED to manage window 0x%x", win); } }