Commit 73e14b623fc960385f60f3eed06583c27fb5d9df

Authored by ths
1 parent 768a4a36

Reduce VNC resize traffic, thanks Eduardo Felipe.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2245 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 1 deletions
@@ -167,6 +167,7 @@ static void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h, @@ -167,6 +167,7 @@ static void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h,
167 167
168 static void vnc_dpy_resize(DisplayState *ds, int w, int h) 168 static void vnc_dpy_resize(DisplayState *ds, int w, int h)
169 { 169 {
  170 + int size_changed;
170 VncState *vs = ds->opaque; 171 VncState *vs = ds->opaque;
171 172
172 ds->data = realloc(ds->data, w * h * vs->depth); 173 ds->data = realloc(ds->data, w * h * vs->depth);
@@ -178,10 +179,11 @@ static void vnc_dpy_resize(DisplayState *ds, int w, int h) @@ -178,10 +179,11 @@ static void vnc_dpy_resize(DisplayState *ds, int w, int h)
178 } 179 }
179 180
180 ds->depth = vs->depth * 8; 181 ds->depth = vs->depth * 8;
  182 + size_changed = ds->width != w || ds->height != h;
181 ds->width = w; 183 ds->width = w;
182 ds->height = h; 184 ds->height = h;
183 ds->linesize = w * vs->depth; 185 ds->linesize = w * vs->depth;
184 - if (vs->csock != -1 && vs->has_resize) { 186 + if (vs->csock != -1 && vs->has_resize && size_changed) {
185 vnc_write_u8(vs, 0); /* msg id */ 187 vnc_write_u8(vs, 0); /* msg id */
186 vnc_write_u8(vs, 0); 188 vnc_write_u8(vs, 0);
187 vnc_write_u16(vs, 1); /* number of rects */ 189 vnc_write_u16(vs, 1); /* number of rects */