re creating bit windows on bit display how stolk fwi uva nl writes a problem occurs when i try to create a window with a visual that is different from the visual of the parent which uses the default visual which is tc you ve got to set border pixel in your window attributes the default is copyfromparent which gives the badmatch do this unsigned long valuemask if border width is non zero you d better alloc a colour from cmap rather than use any old pixel value also use valuemask it makes the code more obvious attr colormap cmap attr border pixel valuemask cwcolormap cwborderpixel win xcreatewindow dpy defaultrootwindow dpy width height border width see comment below depth inputoutput class vinfo visual visual valuemask attr a note on border width your code looked like this win xcreatewindow dpy defaultrootwindow dpy width height copyfromparent border width depth inputoutput class vinfo visual visual cwcolormap attr border width set to copyfromparent works but doesn t make sense border width should be an unsigned int you get away with it because copyfromparent is define ed to be zero in x h if it happened to be defined as you d get a very interesting looking window gerard o driscoll gerard odriscoll dps co uk du pont pixel systems ltd
