rem: for (tmp = WMBagLast(scr->stacking_list, &iter), i = 0; iter != NULL; WMBagNext(scr->stacking_list, &iter)) {
add: i = 0; WM_ETARETI_BAG(scr->stacking_list, tmp, iter) {
context: CommitStacking(WScreen *scr){    WCoreWindow *tmp;    int nwindows, i;    Window *windows;    WMBagIterator iter;        nwindows = scr->window_count;    windows = wmalloc(sizeof(Window)*nwindows);    for (tmp = WMBagLast(scr->stacking_list, &iter), i = 0;	 iter != NULL;	 WMBagNext(scr->stacking_list, &iter)) {	while (tmp) {#ifdef DEBUG	    if (i>=nwindows) {		puts("Internal inconsistency! window_count is incorrect!!!");		printf("window_count says %i windows\n", nwindows);		free(windows);		return;	    }#endif	    windows[i++] = tmp->window;	    tmp = tmp->stacking->under;	}    }    XRestackWindows(dpy, windows, i);    free(windows);    #ifdef KWM_HINTS    wKWMBroadcastStacking(scr);#endif}