- /* Only need to erase the window if the origin moved */
- if (oxmin != state->xmin || oymin != state->ymin)
- XClearWindow (state->dpy, state->window);
- else if (state->fps_p && oymax != state->ymax)
- XFillRectangle (state->dpy, state->window, state->erase_gc,
- 0, state->xgwa.height - state->font_height,
- state->xgwa.width, state->font_height);
-
+ if (state->dbuf && (state->ba))
+ {
+ if (oxmax != state->xmax || oymax != state->ymax)
+ {
+ XFreePixmap (state->dpy, state->ba);
+ state->ba = XCreatePixmap (state->dpy, state->window,
+ state->xgwa.width, state->xgwa.height,
+ state->xgwa.depth);
+ XFillRectangle (state->dpy, state->ba, state->erase_gc, 0, 0,
+ state->xgwa.width, state->xgwa.height);
+ state->b = state->ba;
+ }
+ }
+ else
+ {
+ /* Only need to erase the window if the origin moved */
+ if (oxmin != state->xmin || oymin != state->ymin)
+ XClearWindow (state->dpy, state->window);
+ else if (state->fps_p && oymax != state->ymax)
+ XFillRectangle (state->dpy, state->b, state->erase_gc,
+ 0, state->xgwa.height - state->font_height,
+ state->xgwa.width, state->font_height);
+ }