+ if ((st->f->cycles % 10) == 0)
+ {
+ /* Restart if the window size changes */
+ XGetWindowAttributes(st->dpy, st->window, &st->xgwa);
+
+ if (st->f->height != st->xgwa.height || st->f->width != st->xgwa.width)
+ {
+ st->f->height = st->xgwa.height;
+ st->f->width = st->xgwa.width;
+ st->f->visdepth = st->xgwa.depth;
+
+ build_field(st->dpy, st->window, st->xgwa, st->fgc, st->f);
+ XSetForeground(st->dpy, st->fgc, st->gcv.background);
+ XFillRectangle(st->dpy, st->window, st->fgc, 0, 0, st->xgwa.width, st->xgwa.height);
+ XSetForeground(st->dpy, st->fgc, st->gcv.foreground);
+ }
+ }