All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] vnc: unbreak older gtk-vnc
@ 2021-01-25 10:40 Gerd Hoffmann
  2021-01-25 10:40 ` [PATCH v2 1/2] Revert "vnc: move initialization to framebuffer_update_request" Gerd Hoffmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2021-01-25 10:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann



Gerd Hoffmann (2):
  Revert "vnc: move initialization to framebuffer_update_request"
  vnc: send extended desktop resize on update requests

 ui/vnc.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

-- 
2.29.2




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] Revert "vnc: move initialization to framebuffer_update_request"
  2021-01-25 10:40 [PATCH v2 0/2] vnc: unbreak older gtk-vnc Gerd Hoffmann
@ 2021-01-25 10:40 ` Gerd Hoffmann
  2021-01-25 10:40 ` [PATCH v2 2/2] vnc: send extended desktop resize on update requests Gerd Hoffmann
  2021-01-26  0:01 ` [PATCH v2 0/2] vnc: unbreak older gtk-vnc Laszlo Ersek
  2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2021-01-25 10:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

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 <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 66f7c1b9361e..2622f82a5a9f 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)
-- 
2.29.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] vnc: send extended desktop resize on update requests
  2021-01-25 10:40 [PATCH v2 0/2] vnc: unbreak older gtk-vnc Gerd Hoffmann
  2021-01-25 10:40 ` [PATCH v2 1/2] Revert "vnc: move initialization to framebuffer_update_request" Gerd Hoffmann
@ 2021-01-25 10:40 ` Gerd Hoffmann
  2021-01-26  0:01 ` [PATCH v2 0/2] vnc: unbreak older gtk-vnc Laszlo Ersek
  2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2021-01-25 10:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

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 <kraxel@redhat.com>
---
 ui/vnc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ui/vnc.c b/ui/vnc.c
index 2622f82a5a9f..16bb3be770b2 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);
+        }
     }
 }
 
-- 
2.29.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 0/2] vnc: unbreak older gtk-vnc
  2021-01-25 10:40 [PATCH v2 0/2] vnc: unbreak older gtk-vnc Gerd Hoffmann
  2021-01-25 10:40 ` [PATCH v2 1/2] Revert "vnc: move initialization to framebuffer_update_request" Gerd Hoffmann
  2021-01-25 10:40 ` [PATCH v2 2/2] vnc: send extended desktop resize on update requests Gerd Hoffmann
@ 2021-01-26  0:01 ` Laszlo Ersek
  2 siblings, 0 replies; 4+ messages in thread
From: Laszlo Ersek @ 2021-01-26  0:01 UTC (permalink / raw)
  To: Gerd Hoffmann, qemu-devel

On 01/25/21 11:40, Gerd Hoffmann wrote:
> 
> 
> Gerd Hoffmann (2):
>   Revert "vnc: move initialization to framebuffer_update_request"
>   vnc: send extended desktop resize on update requests
> 
>  ui/vnc.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 

I didn't test desktop resize, but I can confirm the regression is gone.

Tested-by: Laszlo Ersek <lersek@redhat.com>

Thanks!
Laszlo



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-26  0:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 10:40 [PATCH v2 0/2] vnc: unbreak older gtk-vnc Gerd Hoffmann
2021-01-25 10:40 ` [PATCH v2 1/2] Revert "vnc: move initialization to framebuffer_update_request" Gerd Hoffmann
2021-01-25 10:40 ` [PATCH v2 2/2] vnc: send extended desktop resize on update requests Gerd Hoffmann
2021-01-26  0:01 ` [PATCH v2 0/2] vnc: unbreak older gtk-vnc Laszlo Ersek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.