add: wwin = scr->focused_window; while (wwin) { if (wwin->flags.hidden) { WApplication *wapp = wApplicationOf(wwin->main_window);  if (wapp) { wwin->flags.hidden = 0; wHideApplication(wapp); } else { wwin->flags.hidden = 0; } } wwin = wwin->prev; }
context: manageAllWindows(WScreen *scr){    Window root, parent;    Window *children;    unsigned int nchildren;    XWindowAttributes wattribs;    unsigned int i, j;    int state;    WWindow *wwin;    XWMHints *wmhints;        XGrabServer(dpy);    XQueryTree(dpy, scr->root_win, &root, &parent, &children, &nchildren);    scr->flags.startup = 1;    /* first remove all icon windows */    for (i=0; i<nchildren; i++) {	if (children[i]==None) 	  continue;    	wmhints = XGetWMHints(dpy, children[i]);	if (wmhints && (wmhints->flags & IconWindowHint)) {	    for (j = 0; j < nchildren; j++)  {		if (children[j] == wmhints->icon_window) {		    XFree(wmhints);		    wmhints = NULL;		    children[j] = None;		    break;		}	    }	}	if (wmhints) {	    XFree(wmhints);	}    }    /* map all windows without OverrideRedirect */    for (i=0; i<nchildren; i++) {	if (children[i]==None) 	  continue;#ifdef KWM_HINTS	wKWMCheckModule(scr, children[i]);#endif	XGetWindowAttributes(dpy, children[i], &wattribs);	state = getState(children[i]);	if (!wattribs.override_redirect 	    && (state>=0 || wattribs.map_state!=IsUnmapped)) {	    XUnmapWindow(dpy, children[i]);	    	    if (state==WithdrawnState) {		/* move the window far away so that it doesn't flash */		XMoveWindow(dpy, children[i], scr->scr_width+10,			    scr->scr_height+10);	    }	    wwin = wManageWindow(scr, children[i]);	    if (wwin) {		if (state==WithdrawnState) {		    wwin->flags.mapped = 0;		    wClientSetState(wwin, WithdrawnState, None);		    XSelectInput(dpy, wwin->client_win, NoEventMask);		    XRemoveFromSaveSet(dpy, wwin->client_win);		    wUnmanageWindow(wwin, True, False);                } else {                    /* apply states got from WSavedState */                    /* shaded + minimized is not restored correctly */                    if (wwin->flags.shaded) {			wwin->flags.shaded = 0;                        wShadeWindow(wwin);                    }                    if (wwin->flags.hidden) {                        WApplication *wapp = wApplicationOf(wwin->main_window);                        wwin->flags.hidden = 0;                        if (wapp) {                            wHideApplication(wapp);                        }                        wwin->flags.ignore_next_unmap=1;                    } else {                        if (wwin->wm_hints &&                            (wwin->wm_hints->flags & StateHint) && state<0)                            state=wwin->wm_hints->initial_state;                        if (state==IconicState) {			    /* iconify if it's not a transient */			    if (wwin->transient_for==None 				|| wwin->transient_for==wwin->client_win				|| !windowInList(wwin->transient_for,						 children, nchildren)) {			        wwin->flags.miniaturized = 0;				wIconifyWindow(wwin);				wwin->flags.ignore_next_unmap=1;			    }                        } else {                            wClientSetState(wwin, NormalState, None);                        }                    }                }            }	    if (state==WithdrawnState) {		/* move the window back to it's old position */		XMoveWindow(dpy, children[i], wattribs.x, wattribs.y);	    }	}    }    XUngrabServer(dpy);    XFree(children);    scr->flags.startup = 0;    scr->flags.startup2 = 1;    while (XPending(dpy)) {	XEvent ev;	WMNextEvent(dpy, &ev);	WMHandleEvent(&ev);    }    wWorkspaceForceChange(scr, 0);    if (!wPreferences.flags.noclip)        wDockShowIcons(scr->workspaces[scr->current_workspace]->clip);    scr->flags.startup2 = 0;}