From: "Eduardo Felipe" <edusaper@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH]VNC: send NewDesktopSize only when needed
Date: Sun, 10 Dec 2006 23:16:45 +0100 [thread overview]
Message-ID: <83a4d4ca0612101416j70257297ya25ead3213fc1de6@mail.gmail.com> (raw)
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 */
reply other threads:[~2006-12-10 22:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83a4d4ca0612101416j70257297ya25ead3213fc1de6@mail.gmail.com \
--to=edusaper@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).