rem: XSelectInput(dpy, wwin->client_win, NoEventMask); XRemoveFromSaveSet(dpy, wwin->client_win); wClientSetState(wwin, WithdrawnState, None); wUnmanageWindow(wwin, True);
add: if (!reparented) wClientSetState(wwin, WithdrawnState, None);   wUnmanageWindow(wwin, !reparented);
context: handleUnmapNotify(XEvent *event){    WWindow *wwin;    XEvent ev;    #ifdef DEBUG    puts("got unmap");#endif    wwin = wWindowFor(event->xunmap.window);    if (!wwin || wwin->client_win!=event->xunmap.window)	return;        if (!wwin->flags.mapped 	&& wwin->frame->workspace==wwin->screen_ptr->current_workspace	&& !wwin->flags.miniaturized && !wwin->flags.hidden)	return;    if (wwin->flags.ignore_next_unmap) {	return;    }    XGrabServer(dpy);    XUnmapWindow(dpy, wwin->frame->core->window);    wwin->flags.mapped = 0;    XSync(dpy, 0);    /* check if the window was destroyed */    if (XCheckTypedWindowEvent(dpy, wwin->client_win, DestroyNotify,&ev)) {	DispatchEvent(&ev);    } else {	/* withdraw window */	wwin->flags.mapped = 0;	XSelectInput(dpy, wwin->client_win, NoEventMask);	XRemoveFromSaveSet(dpy, wwin->client_win);	wClientSetState(wwin, WithdrawnState, None);	wUnmanageWindow(wwin, True);    }    XUngrabServer(dpy);}