summaryrefslogtreecommitdiffstats
path: root/unix/xserver
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2008-10-13 08:10:24 +0000
committerAdam Tkac <atkac@redhat.com>2008-10-13 08:10:24 +0000
commitd9cae53cdd4a17240911510b23fb66049e5588bd (patch)
treefd09e8643153e220e5b21794d7fbfbb626af4838 /unix/xserver
parentfee32e33ab725f67d42f3d627ff1e26b4f5e40c9 (diff)
downloadtigervnc-d9cae53cdd4a17240911510b23fb66049e5588bd.tar.gz
tigervnc-d9cae53cdd4a17240911510b23fb66049e5588bd.zip
[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
Diffstat (limited to 'unix/xserver')
-rw-r--r--unix/xserver/hw/vnc/xvnc.cc37
1 files changed, 34 insertions, 3 deletions
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 <X11/keysym.h>
- 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);