[gtk-vnc] src: avoid sending a resize with dimensions -1, -1



commit 7c45b33d4e52d7c8a26b750897c116c0d7bcd2b6
Author: Daniel P. Berrangé <dan berrange com>
Date:   Thu Mar 11 10:14:47 2021 +0000

    src: avoid sending a resize with dimensions -1, -1
    
    When we receive a desktop resize request, we blank out the last resize
    data, but we failed to cancel the timer. This results in us later
    sending a resize for -1, -1, which is interpreted as 65535, 65535
    and then clamped to the max possible framebuffer size by the server.
    
    Signed-off-by: Daniel P. Berrangé <berrange redhat com>

 src/vncdisplay.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/vncdisplay.c b/src/vncdisplay.c
index 073bbc4..3680e26 100644
--- a/src/vncdisplay.c
+++ b/src/vncdisplay.c
@@ -1362,8 +1362,12 @@ static void on_desktop_resize(VncConnection *conn G_GNUC_UNUSED,
     VncDisplayPrivate *priv = obj->priv;
     const VncPixelFormat *remoteFormat;
 
-    priv->last_resize_reqw = -1;
-    priv->last_resize_reqh = -1;
+    if (priv->pending_resize_id) {
+        VNC_DEBUG("Cancel pending resize timer %lu", priv->pending_resize_id);
+        g_source_remove(priv->pending_resize_id);
+        priv->last_resize_reqw = -1;
+        priv->last_resize_reqh = -1;
+    }
 
     remoteFormat = vnc_connection_get_pixel_format(priv->conn);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]