开发者

X11 and ARGB visuals: does DefaultDepth() never return 32?

I'm establishing a connection to the X server like this:

display = XOpenDisplay(NULL);
screen = DefaultScreen(display);
depth = DefaultDepth(display, screen);

I'm wondering now why "depth" is always set to 24. I would expect that it is only 24 when compositing is turned off, but in fact, it is still 24 even when I turn on compositing. So in order to get a 32-bit ARGB visual I need to call XGetVisualInfo() first with depth set explicitly to 32.

Now to my question: Will DefaultDepth() generally never return more than 24 or is it just on开发者_Go百科 my system? (my graphics board is somewhat dated...). I know that it could return 15, 16 or even 8 for a CLUT display but can it return 32? Or do I always have to use XGetVisualInfo() first to get a ARGB 32-bit visual?

Thanks,

Andy


DefaultDepth in the X protocol refers to color depth. It does not include alpha. This is sort of ugly, but that's what 20+ years of non-Composite-aware apps assume.

Yes, it can return more than 24. Depth 30 displays are not common, but do exist.


There is a "DefaultDepth" parameter in xorg.conf, in section "Screen". Try to change it.

Depth is detected from root_depth field: http://www.google.com/codesearch?hl=en&safe=off&q=root_depth&aq=f&aqi=g-sx10&aql=&oq=&gs_rfai=

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜