qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH]VNC: send NewDesktopSize only when needed


From: Eduardo Felipe
Subject: [Qemu-devel] [PATCH]VNC: send NewDesktopSize only when needed
Date: Sun, 10 Dec 2006 23:16:45 +0100

Hi,

Patch below makes VNC server send NewDesktopSize message only when necessary.

Without it UltraVNC client goes crazy, as it sends a SetPixelFormat
message each time it receives a resize, which makes qemu VNC server
trigger a new (unnecessary) resize, and so on...

Regards,


Index: vnc.c
===================================================================
RCS file: /sources/qemu/qemu/vnc.c,v
retrieving revision 1.8
diff -u -r1.8 vnc.c
--- vnc.c       24 Aug 2006 20:36:44 -0000      1.8
+++ vnc.c       10 Dec 2006 21:25:11 -0000
@@ -167,6 +167,7 @@

static void vnc_dpy_resize(DisplayState *ds, int w, int h)
{
+    int size_changed;
    VncState *vs = ds->opaque;

    ds->data = realloc(ds->data, w * h * vs->depth);
@@ -178,10 +179,11 @@
    }

    ds->depth = vs->depth * 8;
+    size_changed = ds->width != w || ds->height != h;
    ds->width = w;
    ds->height = h;
    ds->linesize = w * vs->depth;
-    if (vs->csock != -1 && vs->has_resize) {
+    if (vs->csock != -1 && vs->has_resize && size_changed) {
        vnc_write_u8(vs, 0);  /* msg id */
        vnc_write_u8(vs, 0);
        vnc_write_u16(vs, 1); /* number of rects */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]