diff options
author | Pierre Ossman <ossman@cendio.se> | 2009-04-03 12:40:01 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2009-04-03 12:40:01 +0000 |
commit | d2e8f54dc203d61069f6c6959d246a8b0c5fabd1 (patch) | |
tree | b51eb7e521a0ed271b95260b2c7c0a8867d5c3be /unix/xserver/hw/vnc/XserverDesktop.cc | |
parent | e34390b8f76c5b5ab6d16df2e3283f89c9a77b96 (diff) | |
download | tigervnc-d2e8f54dc203d61069f6c6959d246a8b0c5fabd1.tar.gz tigervnc-d2e8f54dc203d61069f6c6959d246a8b0c5fabd1.zip |
Avoid touching PixelFormat internals.
We forgot to update the internal variables with the previous version which
caused problems with some clients (first noticed with gtk-vnc).
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3746 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/xserver/hw/vnc/XserverDesktop.cc')
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.cc | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index d4965d85..9ad283b8 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -172,7 +172,8 @@ public: XserverDesktop::XserverDesktop(ScreenPtr pScreen_, network::TcpListener* listener_, network::TcpListener* httpListener_, - const char* name, void* fbptr, int stride) + const char* name, const rfb::PixelFormat &pf, + void* fbptr, int stride) : pScreen(pScreen_), deferredUpdateTimer(0), dummyTimer(0), server(0), httpServer(0), listener(listener_), httpListener(httpListener_), @@ -181,41 +182,7 @@ XserverDesktop::XserverDesktop(ScreenPtr pScreen_, oldButtonMask(0), queryConnectId(0) { - int i; - format.depth = pScreen->rootDepth; - for (i = 0; i < screenInfo.numPixmapFormats; i++) { - if (screenInfo.formats[i].depth == format.depth) { - format.bpp = screenInfo.formats[i].bitsPerPixel; - break; - } - } - if (i == screenInfo.numPixmapFormats) { - fprintf(stderr,"no pixmap format for root depth???\n"); - abort(); - } - format.bigEndian = (screenInfo.imageByteOrder == MSBFirst); - - VisualPtr vis = NULL; - for (i = 0; i < pScreen->numVisuals; i++) { - if (pScreen->visuals[i].vid == pScreen->rootVisual) { - vis = &pScreen->visuals[i]; - break; - } - } - if (i == pScreen->numVisuals) { - fprintf(stderr,"no visual rec for root visual???\n"); - abort(); - } - format.trueColour = (vis->c_class == TrueColor); - if (!format.trueColour && format.bpp != 8) - throw rfb::Exception("X server uses unsupported visual"); - format.redShift = ffs(vis->redMask) - 1; - format.greenShift = ffs(vis->greenMask) - 1; - format.blueShift = ffs(vis->blueMask) - 1; - format.redMax = vis->redMask >> format.redShift; - format.greenMax = vis->greenMask >> format.greenShift; - format.blueMax = vis->blueMask >> format.blueShift; - + format = pf; colourmap = this; serverReset(pScreen); |