diff options
author | runge <runge> | 2008-06-01 03:36:47 +0000 |
---|---|---|
committer | runge <runge> | 2008-06-01 03:36:47 +0000 |
commit | 65b42bb85354cce814316a646a4a5ed6025a18e3 (patch) | |
tree | 7cac435d5e12f3e49c1e89d3987510afd66b5169 /x11vnc/connections.c | |
parent | 1983292eb0744ef708b0c01877713b59c42a2e13 (diff) | |
download | libtdevnc-65b42bb85354cce814316a646a4a5ed6025a18e3.tar.gz libtdevnc-65b42bb85354cce814316a646a4a5ed6025a18e3.zip |
x11vnc: support colormaps for depths other than 8. xinerama warppointer only if more than one subscreen.
Diffstat (limited to 'x11vnc/connections.c')
-rw-r--r-- | x11vnc/connections.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/x11vnc/connections.c b/x11vnc/connections.c index 2381ef2..f253204 100644 --- a/x11vnc/connections.c +++ b/x11vnc/connections.c @@ -2734,6 +2734,23 @@ void check_gui_inputs(void) { } } +static int turn_off_truecolor = 0; + +static void turn_off_truecolor_ad(rfbClientPtr client) { + if (turn_off_truecolor) { + rfbLog("turning off truecolor advertising.\n"); + screen->serverFormat.trueColour = FALSE; + screen->displayHook = NULL; + screen->serverFormat.redShift = 0; + screen->serverFormat.greenShift = 0; + screen->serverFormat.blueShift = 0; + screen->serverFormat.redMax = 0; + screen->serverFormat.greenMax = 0; + screen->serverFormat.blueMax = 0; + turn_off_truecolor = 0; + } +} + /* * libvncserver callback for when a new client connects */ @@ -2877,6 +2894,43 @@ enum rfbNewClientAction new_client(rfbClientPtr client) { check_ncache(1, 0); } + if (advertise_truecolor && indexed_color) { + int rs = 0, gs = 2, bs = 4; + int rm = 3, gm = 3, bm = 3; + if (bpp >= 24) { + rs = 0, gs = 8, bs = 16; + rm = 255, gm = 255, bm = 255; + } else if (bpp >= 16) { + rs = 0, gs = 5, bs = 10; + rm = 31, gm = 31, bm = 31; + } + rfbLog("advertising truecolor.\n"); + if (getenv("ADVERT_BMSHIFT")) { + bm--; + } + + client->format.trueColour = TRUE; + client->format.redShift = rs; + client->format.greenShift = gs; + client->format.blueShift = bs; + client->format.redMax = rm; + client->format.greenMax = gm; + client->format.blueMax = bm; + + rfbSetTranslateFunction(client); + + screen->serverFormat.trueColour = TRUE; + screen->serverFormat.redShift = rs; + screen->serverFormat.greenShift = gs; + screen->serverFormat.blueShift = bs; + screen->serverFormat.redMax = rm; + screen->serverFormat.greenMax = gm; + screen->serverFormat.blueMax = bm; + screen->displayHook = turn_off_truecolor_ad; + + turn_off_truecolor = 1; + } + if (unixpw) { unixpw_in_progress = 1; unixpw_client = client; |