From d9cae53cdd4a17240911510b23fb66049e5588bd Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Mon, 13 Oct 2008 08:10:24 +0000 Subject: [Bugfix] Fixed screen initialization - use correct depths and richer set of visuals. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3005 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- unix/xserver/hw/vnc/xvnc.cc | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'unix/xserver') diff --git a/unix/xserver/hw/vnc/xvnc.cc b/unix/xserver/hw/vnc/xvnc.cc index effd0f2d..cc32bc0c 100644 --- a/unix/xserver/hw/vnc/xvnc.cc +++ b/unix/xserver/hw/vnc/xvnc.cc @@ -81,7 +81,6 @@ extern "C" { #include "miline.h" #include "inputstr.h" #include - extern int defaultColorVisualClass; extern char buildtime[]; #undef class #undef public @@ -1068,8 +1067,40 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) if (!pbits) return FALSE; vncFbptr[index] = pbits; - defaultColorVisualClass - = (pvfb->bitsPerPixel > 8) ? TrueColor : PseudoColor; + miSetPixmapDepths(); + + switch (pvfb->depth) { + case 8: + miSetVisualTypesAndMasks (8, + ((1 << StaticGray) | + (1 << GrayScale) | + (1 << StaticColor) | + (1 << PseudoColor) | + (1 << TrueColor) | + (1 << DirectColor)), + 8, PseudoColor, 0, 0, 0); + break; + case 16: + miSetVisualTypesAndMasks (16, + ((1 << TrueColor) | + (1 << DirectColor)), + 8, TrueColor, 0xf800, 0x07e0, 0x001f); + break; + case 24: + miSetVisualTypesAndMasks (24, + ((1 << TrueColor) | + (1 << DirectColor)), + 8, TrueColor, 0xff0000, 0x00ff00, 0x0000ff); + break; + case 32: + miSetVisualTypesAndMasks (32, + ((1 << TrueColor) | + (1 << DirectColor)), + 8, TrueColor, 0xff000000, 0x00ff0000, 0x0000ff00); + break; + default: + return FALSE; + } ret = fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height, dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel); -- cgit v1.2.3