aboutsummaryrefslogtreecommitdiff
path: root/ui/vnc.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2021-01-12 14:41:19 +0100
committerGerd Hoffmann <kraxel@redhat.com>2021-01-15 11:22:43 +0100
commit9e1632ad07ca49de99da4bb231e9e2f22f2d8df5 (patch)
tree001defe835130ec929bae856d82d1a5a20956426 /ui/vnc.c
parentb3c2de9cd5bc0023901e7a4d568dfc5152b6cc4a (diff)
vnc: move initialization to framebuffer_update_request
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
Diffstat (limited to 'ui/vnc.c')
-rw-r--r--ui/vnc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/ui/vnc.c b/ui/vnc.c
index 0f01481cac..b4e98cf647 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)