re creating bit windows on bit display how in article apr fwi uva nl stolk fwi uva nl bram writes i am using an x server that provides visuals pseudocolor bit truecolor bit and directcolor bit lucky dog 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 in the xlib reference guide from o reilly one can read in the section about xcteatewindow something like in the current implementation of x when using a visual other than the parent s be sure to create or find a suitable colourmap which is to be used in the window attributes when creating or else a badmatch occurs this warning strangely enough is only mentioned in the newer editions of the x r guides it applies with equal force to earlier versions presumably only recently did the author s decide it was important enough to mention the necessity it refers to has always been there but it s been implicit in the way createwindow requests default some attributes of the new window however even if i pass along a suitable colourmap i still get a badmatch when i create a window with a non default visual attr colormap cmap win xcreatewindow copyfromparent border width depth inputoutput class vinfo visual visual cwcolormap attr this is because the warning you read is incomplete you have to provide not only a colormap but also a border the default border is copyfromparent which is not valid when the window s depth doesn t match its parent s specify a border pixmap of the correct depth or a border pixel and the problem should go away there is another problem i can t find anything to indicate that copyfromparent makes any sense as the border width parameter to xcreatewindow your xlib implementation probably defines copyfromparent as zero to simplify the conversion to wire format so you are unwittingly asking for a border width of zero due to the xlib implementation not providing stricter type checking to be fair i m not entirely certain it s possible for xlib to catch this der mouse mouse mcrcim mcgill edu
