qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P . Berrangé" <berrange@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [PULL 10/11] vnc: move initialization to framebuffer_update_request
Date: Fri, 15 Jan 2021 11:24:23 +0100	[thread overview]
Message-ID: <20210115102424.1360437-11-kraxel@redhat.com> (raw)
In-Reply-To: <20210115102424.1360437-1-kraxel@redhat.com>

qemu sends various state info like current cursor shape to newly connected
clients in response to a set_encoding message.  This is not correct according
to the rfb spec.  Send that information in response to a full (incremental=0)
framebuffer update request instead.  Also send the resize information
unconditionally, not only in case of an actual server-side change.

This makes the qemu vnc server conform to the spec and allows clients to
request the complete vnc server state without reconnect.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20210112134120.2031837-3-kraxel@redhat.com
---
 ui/vnc.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/ui/vnc.c b/ui/vnc.c
index 0f01481cac57..b4e98cf647f5 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -661,10 +661,6 @@ static void vnc_desktop_resize(VncState *vs)
     if (vs->ioc == NULL || !vnc_has_feature(vs, VNC_FEATURE_RESIZE)) {
         return;
     }
-    if (vs->client_width == pixman_image_get_width(vs->vd->server) &&
-        vs->client_height == pixman_image_get_height(vs->vd->server)) {
-        return;
-    }
 
     assert(pixman_image_get_width(vs->vd->server) < 65536 &&
            pixman_image_get_width(vs->vd->server) >= 0);
@@ -2014,6 +2010,10 @@ static void framebuffer_update_request(VncState *vs, int incremental,
     } else {
         vs->update = VNC_STATE_UPDATE_FORCE;
         vnc_set_area_dirty(vs->dirty, vs->vd, x, y, w, h);
+        vnc_colordepth(vs);
+        vnc_desktop_resize(vs);
+        vnc_led_state_change(vs);
+        vnc_cursor_define(vs);
     }
 }
 
@@ -2154,10 +2154,7 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
             break;
         }
     }
-    vnc_desktop_resize(vs);
     check_pointer_type_change(&vs->mouse_mode_notifier, NULL);
-    vnc_led_state_change(vs);
-    vnc_cursor_define(vs);
 }
 
 static void set_pixel_conversion(VncState *vs)
-- 
2.29.2



  parent reply	other threads:[~2021-01-15 10:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 10:24 [PULL 00/11] Ui 20210115 patches Gerd Hoffmann
2021-01-15 10:24 ` [PULL 01/11] ui/gtk: don't try to redefine SI prefixes Gerd Hoffmann
2021-01-15 10:24 ` [PULL 02/11] ui/gtk: rename variable window to widget Gerd Hoffmann
2021-01-15 10:24 ` [PULL 03/11] ui/gtk: limit virtual console max update interval Gerd Hoffmann
2021-01-15 10:24 ` [PULL 04/11] ui/gtk: expose gd_monitor_update_interval Gerd Hoffmann
2021-01-15 10:24 ` [PULL 05/11] ui/gtk: update monitor interval on egl displays Gerd Hoffmann
2021-01-15 10:24 ` [PULL 06/11] vnc: fix unfinalized tlscreds for VncDisplay Gerd Hoffmann
2021-01-15 10:24 ` [PULL 07/11] ui: add support for remote power control to VNC server Gerd Hoffmann
2021-01-15 10:24 ` [PULL 08/11] vnc: Fix a memleak in vnc_display_connect() Gerd Hoffmann
2021-01-15 10:24 ` [PULL 09/11] vnc: move check into vnc_cursor_define Gerd Hoffmann
2021-01-15 10:24 ` Gerd Hoffmann [this message]
2021-01-21 21:22   ` [PULL 10/11] vnc: move initialization to framebuffer_update_request Laszlo Ersek
2021-01-22  2:06     ` Laszlo Ersek
2021-01-22  8:46     ` Gerd Hoffmann
2021-01-22 12:49       ` Laszlo Ersek
2021-01-22 13:42         ` Gerd Hoffmann
2021-01-15 10:24 ` [PULL 11/11] vnc: add support for extended desktop resize Gerd Hoffmann
2021-01-15 20:04 ` [PULL 00/11] Ui 20210115 patches Peter Maydell

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=20210115102424.1360437-11-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=berrange@redhat.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).