for (s = d->screens; s; s = s->next) for (w = s->windows; w; w = w->next) if (wid == w->id) orig = w;