- GC gc = NULL;
-
- /* #### This isn't quite right for when this function is called
- from the toolbar code. */
- background_pixmap = Qunbound;
-
- /* Don't use a backing pixmap in the border area */
- if (x >= FRAME_LEFT_BORDER_END (f)
- && x < FRAME_RIGHT_BORDER_START (f)
- && y >= FRAME_TOP_BORDER_END (f)
- && y < FRAME_BOTTOM_BORDER_START (f))
- {
- Lisp_Object temp;
-
- if (w)
- {
- temp = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, findex);
-
- if (IMAGE_INSTANCEP (temp)
- && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp)))
- {
- /* #### maybe we could implement such that a string
- can be a background pixmap? */
- background_pixmap = temp;
- }
- }
- else
- {
- temp = FACE_BACKGROUND_PIXMAP (Vdefault_face, locale);
-
- if (IMAGE_INSTANCEP (temp)
- && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp)))
- {
- background_pixmap = temp;
- }
- }
-
- if (!UNBOUNDP (background_pixmap) &&
- XIMAGE_INSTANCE_PIXMAP_DEPTH (background_pixmap) == 0)
- {
- Lisp_Object fcolor, bcolor;
-
- if (w)
- {
- fcolor = WINDOW_FACE_CACHEL_FOREGROUND (w, findex);
- bcolor = WINDOW_FACE_CACHEL_BACKGROUND (w, findex);
- }
- else
- {
- fcolor = FACE_FOREGROUND (Vdefault_face, locale);
- bcolor = FACE_BACKGROUND (Vdefault_face, locale);
- }
-
- gc = x_get_gc (d, Qnil, fcolor, bcolor, background_pixmap, Qnil);
- }
- else
- {
- Lisp_Object color = (w ?
- WINDOW_FACE_CACHEL_BACKGROUND (w, findex) :
- FACE_BACKGROUND (Vdefault_face, locale));
-
- if (UNBOUNDP (background_pixmap))
- background_pixmap = Qnil;
-
- gc = x_get_gc (d, Qnil, color, Qnil, background_pixmap, Qnil);
- }
- }
-
- if (gc)
- XFillRectangle (dpy, x_win, gc, x, y, width, height);
- else
- XClearArea (dpy, x_win, x, y, width, height, False);