Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!bloom-beacon!deccrl!news.crl.dec.com!pa.dec.com!wsl.dec.com!klee From: klee@wsl.dec.com (Ken Lee) Newsgroups: comp.windows.x Subject: Re: X Protocol Error? Keywords: BackgroundPixmap, XChangeWindowAttributes Message-ID: <1990Dec14.150042@wsl.dec.com> Date: 14 Dec 90 23:00:42 GMT References: <1050@sppy00.UUCP> Sender: news@pa.dec.com (News) Reply-To: klee@wsl.dec.com Organization: DEC Western Software Laboratory Lines: 22 In article <1050@sppy00.UUCP>, jxf@sppy00.UUCP (Jonathan Fausey) writes: |> pix = XCreateBitmapFromData(wndw_disp, wndw_hndl, |> RawBitmapData, NumBitsPerBitmapLine, |> NumLinesInBitmap); |> WinAttr.background_pixmap = pix; |> win = XCreateWindow(wndw_disp, DefaultRootWindow(wndw_disp), |> ulx, uly, width, height, 4, 1, InputOutput, |> DefaultVisual(wndw_disp,wndw_screen), WinAttrMask, |> &WinAttr); This is poor programming style. XCreateBitmapFromData creates a bitmap, which always has a depth of 1. You're then using this bitmap as a window background pixmap without checking the depth in your visual. If the window has a depth other than 1, you will get a protocol error. You must make sure that window background pixmaps have the same depths as the windows. -- Ken Lee DEC Western Software Laboratory, Palo Alto, Calif. Internet: klee@wsl.dec.com uucp: uunet!decwrl!klee