summaryrefslogtreecommitdiff
path: root/vnc.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2006-12-14 13:36:01 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2006-12-14 13:36:01 +0000
commit73e14b623fc960385f60f3eed06583c27fb5d9df (patch)
treea06fff3bc706a9c67fa176b0601f7c747ccf7e2f /vnc.c
parent768a4a36a444ef5aef1f103adf42553eadfe4614 (diff)
Reduce VNC resize traffic, thanks Eduardo Felipe.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2245 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vnc.c')
-rw-r--r--vnc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vnc.c b/vnc.c
index 19aa4b746..92e48c56e 100644
--- a/vnc.c
+++ b/vnc.c
@@ -167,6 +167,7 @@ static void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h,
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 @@ static void vnc_dpy_resize(DisplayState *ds, int w, int h)
}
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 */