mirror of
https://git.proxmox.com/git/qemu
synced 2025-07-17 20:59:40 +00:00
Reduce VNC resize traffic, thanks Eduardo Felipe.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2245 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
768a4a36a4
commit
73e14b623f
4
vnc.c
4
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)
|
static void vnc_dpy_resize(DisplayState *ds, int w, int h)
|
||||||
{
|
{
|
||||||
|
int size_changed;
|
||||||
VncState *vs = ds->opaque;
|
VncState *vs = ds->opaque;
|
||||||
|
|
||||||
ds->data = realloc(ds->data, w * h * vs->depth);
|
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;
|
ds->depth = vs->depth * 8;
|
||||||
|
size_changed = ds->width != w || ds->height != h;
|
||||||
ds->width = w;
|
ds->width = w;
|
||||||
ds->height = h;
|
ds->height = h;
|
||||||
ds->linesize = w * vs->depth;
|
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); /* msg id */
|
||||||
vnc_write_u8(vs, 0);
|
vnc_write_u8(vs, 0);
|
||||||
vnc_write_u16(vs, 1); /* number of rects */
|
vnc_write_u16(vs, 1); /* number of rects */
|
||||||
|
Loading…
Reference in New Issue
Block a user