rem: WMBagIterator iter; WCoreWindow *core;
context: RestoreDesktop(WScreen *scr){    WMBagIterator iter;    WCoreWindow *core;    if (scr->helper_pid > 0) {	kill(scr->helper_pid, SIGTERM);	scr->helper_pid = 0;    }    XGrabServer(dpy);    wDestroyInspectorPanels();    /* reparent windows back to the root window, keeping the stacking order */    for (core = WMBagFirst(scr->stacking_list, &iter);	 iter != NULL && core != NULL;	 core = WMBagNext(scr->stacking_list, &iter)) {        WCoreWindow *next;        WWindow *wwin;        /* go to the end of the list */        while (core->stacking->under)            core = core->stacking->under;        while (core) {            next = core->stacking->above;                        if (core->descriptor.parent_type==WCLASS_WINDOW) {		Window window;                wwin = core->descriptor.parent;		window = wwin->client_win;                wUnmanageWindow(wwin, !wwin->flags.internal_window, False);		XMapWindow(dpy, window);            }            core = next;        }    }    XUngrabServer(dpy);    XSetInputFocus(dpy, PointerRoot, RevertToParent, CurrentTime);    wColormapInstallForWindow(scr, NULL);    PropCleanUp(scr->root_win);    XSync(dpy, 0);}