summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWouter Van Meir <wouter.vanmeir@pandora.be>2010-05-31 17:33:27 +0200
committerJohannes Schindelin <johannes.schindelin@gmx.de>2010-06-04 11:44:56 +0200
commitf76c81941a001bde59a9c4df5445569d2134ab5b (patch)
treee9595c62bf04399d9e15d61550fd12c1e72f1d23
parent09f7c684a2b7eb43f283dcd938f0ccad891724e8 (diff)
downloadlibtdevnc-f76c8194.tar.gz
libtdevnc-f76c8194.zip
Call MallocFrameBuffer before SetFormatAndEncodings
The hook is still called after InitialiseRFBConnection() so we can choose the color settings depending on the vnc server (or settings) in that hook. This way one can use the "VNC server default format" pixelformat if the client supports it, or perform a workaround (Intel AMT KVM "classic vnc" server only works using 8bit colors in RFB3.8) Signed-off-by: Wouter Van Meir <wouter.vanmeir@pandora.be> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
-rw-r--r--libvncclient/vncviewer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c
index 094ba34..6541c1d 100644
--- a/libvncclient/vncviewer.c
+++ b/libvncclient/vncviewer.c
@@ -221,13 +221,13 @@ static rfbBool rfbInitConnection(rfbClient* client)
if (!InitialiseRFBConnection(client))
return FALSE;
- if (!SetFormatAndEncodings(client))
- return FALSE;
-
client->width=client->si.framebufferWidth;
client->height=client->si.framebufferHeight;
client->MallocFrameBuffer(client);
+ if (!SetFormatAndEncodings(client))
+ return FALSE;
+
if (client->updateRect.x < 0) {
client->updateRect.x = client->updateRect.y = 0;
client->updateRect.w = client->width;