From d239726c53fd9d3b5e6a89c5a22ed57d8ab0a9aa Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 25 Jan 2021 11:40:40 +0100 Subject: Revert "vnc: move initialization to framebuffer_update_request" This reverts commit 9e1632ad07ca49de99da4bb231e9e2f22f2d8df5. Older gtk-vnc versions can't deal with non-incremental update requests sending pseudo-encodings, so trying to send full server state (including desktop size, cursor etc. which is done using pseudo-encodings) doesn't fly. Return to old behavior to send those only for new connects and when changes happen. Signed-off-by: Gerd Hoffmann Tested-by: Laszlo Ersek Message-Id: <20210125104041.495274-2-kraxel@redhat.com> --- ui/vnc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index 66f7c1b936..2622f82a5a 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -687,6 +687,10 @@ static void vnc_desktop_resize(VncState *vs) !vnc_has_feature(vs, VNC_FEATURE_RESIZE_EXT))) { 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); @@ -2042,10 +2046,6 @@ 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); } } @@ -2189,7 +2189,10 @@ 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) -- cgit v1.2.3-55-g7522 From 104b8d193248032bb3357ef7f6f2f2dd5824731e Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 25 Jan 2021 11:40:41 +0100 Subject: vnc: send extended desktop resize on update requests Unlike other pseudo-encodings these don't break gtk-vnc because older versions don't suport the extended desktop resize extension in the first place. Signed-off-by: Gerd Hoffmann Tested-by: Laszlo Ersek Message-Id: <20210125104041.495274-3-kraxel@redhat.com> --- ui/vnc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/vnc.c b/ui/vnc.c index 2622f82a5a..16bb3be770 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2046,6 +2046,9 @@ 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); + if (vnc_has_feature(vs, VNC_FEATURE_RESIZE_EXT)) { + vnc_desktop_resize_ext(vs, 0); + } } } -- cgit v1.2.3-55-g7522 From 15b08119add1e49ccbc7f7d6b3a04932d2430d7e Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 12 Jan 2021 16:16:08 +0000 Subject: hw/display/vmware_vga: Remove dependency on VNC header In commit 2f487a3d40faff1 we fixed a problem observed with using the vmware-vga device and the VNC UI frontend in a belt-and-braces manner: * we made the VNC frontend handle non-multiple-of-16 surface widths * we rounded up the vmware-vga display width to a multiple of 16 However this introduced a spurious dependency of a device model on a UI frontend header. vmware-vga isn't special and should not care about what UI frontend it is using, and the VNC frontend needs to handle arbitrary surface widths because other display device models could use them. Moreover, even if the maximum width in vmware-vga is made a multiple of 16, the guest itself can always program a different width. Remove the dependency on the VNC header. Since we have been using the rounded-up width value since 2014, stick with it rather than introducing a behaviour change, but don't calculate it by rounding up to VNC_DIRTY_BITS_PER_PIXEL any more. Signed-off-by: Peter Maydell Message-Id: <20210112161608.16055-1-peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann --- hw/display/vmware_vga.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index bef0d7d69a..e2969a6c81 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -29,7 +29,6 @@ #include "qemu/log.h" #include "hw/loader.h" #include "trace.h" -#include "ui/vnc.h" #include "hw/pci/pci.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" @@ -220,7 +219,7 @@ enum { /* These values can probably be changed arbitrarily. */ #define SVGA_SCRATCH_SIZE 0x8000 -#define SVGA_MAX_WIDTH ROUND_UP(2360, VNC_DIRTY_PIXELS_PER_BIT) +#define SVGA_MAX_WIDTH 2368 #define SVGA_MAX_HEIGHT 1770 #ifdef VERBOSE -- cgit v1.2.3-55-g7522