/*
 * -- $Header: /cec/src/nestor/servers/R3/shXlib/XBackgnd.c,v 1.1.1.1
 * 90/04/23 09:51:49 spanachi Exp $
 */
#include "copyright.h"

/* $XConsortium: XBackgnd.c,v 11.7 88/09/06 16:04:08 jim Exp $ */
/* Copyright    Massachusetts Institute of Technology    1986	 */

/* -- MULTIPLEX Extension -- */

#include "Xlibint.h"

/* -- additional includes -- */
#include "resources.h"

XSetWindowBackground (dpy, w, pixel)
  register Display *dpy;
  Window w;
  unsigned long pixel;
{
  register xChangeWindowAttributesReq *req;

  LockDisplay (dpy);
  GetReqExtra (ChangeWindowAttributes, 4, req);
  req->window = w;
  req->valueMask = CWBackPixel;
  OneDataCard32 (dpy, NEXTPTR (req, xChangeWindowAttributesReq), pixel);

  /* -- update the appropriate resource info if necessary -- */
  if (XmuXStoreResources (dpy)) {
    XSetWindowAttributes attributes;

    attributes.background_pixel = pixel;
    XmuXUpdateWindowInfo (dpy, w, CWBackPixel, &attributes);
  }
  UnlockDisplay (dpy);
  SyncHandle ();
}
