Commit 8bba5c81b1febeb20cdd60f1c18eb0e695cad6d6

Authored by balrog
1 parent 788228c0

Invalidate VNC framebuffer on every resize.

On a resize, vncviewer keeps the image in the upper-left part of the screen
unmodified and fills the right end of the lines with black colour.  vnc.c       keeps the first n bytes of the framebuffer unmodified instead - meaning that
the client's image doesn't match the image in framebuffer and checking
for dirty rows gives wrong results.  We can either invalidate the whole
buffer or implement the same transformation as the client.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4569 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 4 deletions
... ... @@ -316,6 +316,9 @@ static void vnc_dpy_resize(DisplayState *ds, int w, int h)
316 316 vs->width = ds->width;
317 317 vs->height = ds->height;
318 318 }
  319 +
  320 + memset(vs->dirty_row, 0xFF, sizeof(vs->dirty_row));
  321 + memset(vs->old_data, 42, vs->ds->linesize * vs->ds->height);
319 322 }
320 323  
321 324 /* fastest code */
... ... @@ -1182,8 +1185,6 @@ static void set_pixel_format(VncState *vs,
1182 1185 }
1183 1186  
1184 1187 vnc_dpy_resize(vs->ds, vs->ds->width, vs->ds->height);
1185   - memset(vs->dirty_row, 0xFF, sizeof(vs->dirty_row));
1186   - memset(vs->old_data, 42, vs->ds->linesize * vs->ds->height);
1187 1188  
1188 1189 vga_hw_invalidate();
1189 1190 vga_hw_update();
... ... @@ -1982,8 +1983,6 @@ void vnc_display_init(DisplayState *ds)
1982 1983 vs->ds->dpy_resize = vnc_dpy_resize;
1983 1984 vs->ds->dpy_refresh = NULL;
1984 1985  
1985   - memset(vs->dirty_row, 0xFF, sizeof(vs->dirty_row));
1986   -
1987 1986 vnc_dpy_resize(vs->ds, 640, 400);
1988 1987 }
1989 1988  
... ...