int x_position, int y_position,
int w, int h)
{
+ if (x_position > vs->ds->width)
+ x_position = vs->ds->width;
+ if (y_position > vs->ds->height)
+ y_position = vs->ds->height;
+ if (x_position + w >= vs->ds->width)
+ w = vs->ds->width - x_position;
+ if (y_position + h >= vs->ds->height)
+ h = vs->ds->height - y_position;
+
int i;
vs->need_update = 1;
if (!incremental) {
static int protocol_client_init(VncState *vs, char *data, size_t len)
{
char pad[3] = { 0, 0, 0 };
+ char buf[1024];
+ int size;
vs->width = vs->ds->width;
vs->height = vs->ds->height;
vnc_write(vs, pad, 3); /* padding */
- vnc_write_u32(vs, 4);
- vnc_write(vs, "QEMU", 4);
+ if (qemu_name)
+ size = snprintf(buf, sizeof(buf), "QEMU (%s)", qemu_name);
+ else
+ size = snprintf(buf, sizeof(buf), "QEMU");
+
+ vnc_write_u32(vs, size);
+ vnc_write(vs, buf, size);
vnc_flush(vs);
vnc_read_when(vs, protocol_client_msg, 1);