From: Brian J. <bjj...@us...> - 2001-07-09 18:16:33
|
On 9 Jul 2001 Brian Johnson wrote: > On 6 Jul 2001 Christian Bauer wrote: > > > > I've committed some code that tries to select an optimal visual > > for the requested Mac color depth. However, I was only able to > > test it with X servers that support exactly one depth so it is > > possible that some logic in the code is wrong. I have tried it > > with the 8+24 overlay mode of my Matrox card with XFree86 4.0.3 > > but that gives me a BadMatch error when trying to open a 24-bit > > window, for no apparent reason. > > I see similar behavior on my SGI box, with a 24-bit default visual. > I forget what my default Mac video settings are... probably 8 bit. > B2 starts booting, but appears to try to change the video modes at > some point, and dies with a BadMatch error: ... Here's some interesting info from the VkVisual man page which may be relevant: REVIEW OF X11 VISUAL INFORMATION Many developers do not quite understand how X and Xt deal with information that is related to X11 visuals. This information is important if one is going to put part or all of an application's GUI in a non-default visual. Following is a summary of some of the more important points. X11 Visual Attributes X11 does not attach any semantic meaning to a visual. For example, there is no concept of an "overlay visual". There is, however, a semi-standard convention that has been adopted by SGI and by some other workstation vendors: o A visual's level is the framebuffer level the visual is associated with. This is a hardware-related term. It has nothing to do with X window stacking order. o Levels less than zero are underlays. As of this writing (8/96), SGI has no hardware that has underlay planes that are supported by the X server. o Level zero is the normal planes. The default visual is generally (but not necessarily) in the normal planes. o Levels greater than zero are overlay planes. o Each X11 visual is associated with exactly one level. o SERVER_OVERLAY_VISUALS is a property on the root window, relating each X11 visual to its level. An X11 window has several attributes that need to be consistent when the window is created. If an application sets these values inconsistently, or if it allows an inconsistent value to be inherited, the X server will return a fatal BadMatch error. o XCreateWindow(3X) must be passed a consistent visual and depth. o Certain fields in the XSetWindowAttributes structure that is passed to XCreateWindow(3X) must be consistent with the visual and depth. The significant fields are: background pixmap - must be NULL or of the stated depth. background pixel - is used if the background pixmap is NULL. The pixel value must not exceed the colormap size. border pixmap - must be NULL or of the stated depth. border pixel - is used if the border pixmap is NULL. The pixel value must not exceed the colormap size. colormap - must match the visual. The depth and visual cannot be changed after the window is created. The XSetWindowAttributes values can be changed later. Brian -------------------------------------------------------------------- "With this scheme, it is straightforward to locate a Transport Service Access Point anywhere in the known universe." -- Tanenbaum |