}
printf("\n");
}
+
+ // re-request the entire framebuffer
+ buf[0] = 3; // message type
+ buf[1] = 1; // incremental
+ buf[2] = 0; // xpos
+ buf[3] = 0;
+ buf[4] = 0; // ypos
+ buf[5] = 0;
+ buf[6] = 640 >> 8; // width
+ buf[7] = 640 & 0xff;
+ buf[8] = 480 >> 8; // height
+ buf[9] = 480 & 0xff;
+
+ write(vnc_sock, buf, 10);
}
struct ServerInitialization {
if (read(vnc_sock, buf, ntohl(si.name_len)) != ntohl(si.name_len))
error("short read on server name\n");
- printf("Server name is '%*s' (%u bytes)\n", ntohl(si.name_len), buf, ntohl(si.name_len));
+// printf("Server name is '%*s' (%u bytes)\n", ntohl(si.name_len), buf, ntohl(si.name_len));
// we can only accept raw encoding
buf[0] = 2; // message type
dst = smallblock;
for (y = 0; y < bh; ++y) {
- src = data + ((yt * 64 + (bh + 1 - y)) * width + (xt * 64)) * 4;
+ src = data + ((yt * 64 + (bh - 1 - y)) * width + (xt * 64)) * 4;
for (x = 0; x < bw; ++x) {
*dst++ = *src++;
*dst++ = *src++;
printf("Activity on VNC socket!\n");
- if (read(vnc_sock, buf, 2) != 2)
+ if (read(vnc_sock, buf, 1) != 1)
error("short read on vnc_sock\n");
switch (buf[0]) {
case 0:
// frame buffer update!
+ printf("Framebuffer update\n");
+ if (read(vnc_sock, buf, 1) != 1)
+ error("short read on vnc_sock\n");
handle_vnc_fbupdate(vnc_sock);
break;
+ case 2:
+ printf("\a\n");
+ break;
default:
printf("Unknown VNC server message %x\n", buf[0]);
exit(1);