qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH]VNC: send NewDesktopSize only when needed
@ 2006-12-10 22:16 Eduardo Felipe
  0 siblings, 0 replies; only message in thread
From: Eduardo Felipe @ 2006-12-10 22:16 UTC (permalink / raw)
  To: qemu-devel

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 */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-12-10 22:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-10 22:16 [Qemu-devel] [PATCH]VNC: send NewDesktopSize only when needed Eduardo Felipe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).