summaryrefslogtreecommitdiffstats
path: root/mac.c
diff options
context:
space:
mode:
authordscho <dscho>2002-04-25 08:08:38 +0000
committerdscho <dscho>2002-04-25 08:08:38 +0000
commit160c85f4ecd37b9ab046403e0bc1b5f834a9c3d4 (patch)
treeee3fd29543ccf0e4289d0509a891a848c94605bc /mac.c
parent48e64b87c94f5c799d1fea16aacf3e7a96832535 (diff)
downloadlibtdevnc-160c85f4.tar.gz
libtdevnc-160c85f4.zip
now colour handling should be correct
Diffstat (limited to 'mac.c')
-rw-r--r--mac.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mac.c b/mac.c
index 3a43426..ede3e3d 100644
--- a/mac.c
+++ b/mac.c
@@ -281,11 +281,16 @@ Bool viewOnly = FALSE, sharedMode = FALSE;
void
ScreenInit(int argc, char**argv)
{
+ int bitsPerSample=CGDisplayBitsPerSample(kCGDirectMainDisplay);
rfbScreen = rfbGetScreen(&argc,argv,
CGDisplayPixelsWide(kCGDirectMainDisplay),
CGDisplayPixelsHigh(kCGDirectMainDisplay),
- CGDisplayBitsPerSample(kCGDirectMainDisplay),
+ bitsPerSample,
CGDisplaySamplesPerPixel(kCGDirectMainDisplay),4);
+ rfbScreen->rfbServerFormat->redShift = bitsPerSample*2;
+ rfbScreen->rfbServerFormat->greenShift = bitsPerSample*1;
+ rfbScreen->rfbServerFormat->blueShift = 0;
+
gethostname(rfbScreen->rfbThisHost, 255);
rfbScreen->paddedWidthInBytes = CGDisplayBytesPerRow(kCGDirectMainDisplay);
rfbScreen->frameBuffer =