[gtk-vnc] Revert "src: unset size request if scaling is active"



commit 8d627ee4522c00ca8ced3ac2e4d90a3d37b8ca3a
Author: Daniel P. Berrangé <dan berrange com>
Date:   Thu Apr 1 10:53:25 2021 +0100

    Revert "src: unset size request if scaling is active"
    
    This (mostly) reverts commit 0b0afcad76d208d8c371706123a731e215bff710.
    
    Widget resize requests are handled asynchronously, so when the
    idle func runs, we may not have actually done the resize yet.
    This resulted in the window not honouring the desktop resize
    notifications at all times.
    
    The do_size_request() call in vnc_display_set_scaling was
    a separate bug fix that must be kept.

 src/vncdisplay.c | 12 ------------
 1 file changed, 12 deletions(-)
---
diff --git a/src/vncdisplay.c b/src/vncdisplay.c
index 7915c15..0622227 100644
--- a/src/vncdisplay.c
+++ b/src/vncdisplay.c
@@ -1308,12 +1308,6 @@ static void on_framebuffer_update(VncConnection *conn G_GNUC_UNUSED,
                                               vnc_connection_get_height(priv->conn));
 }
 
-static gboolean do_size_request_clear(gpointer opaque)
-{
-    VNC_DEBUG("Clearing previous size request after idle");
-    gtk_widget_set_size_request(GTK_WIDGET(opaque), -1, -1);
-    return FALSE;
-}
 
 static void do_size_request(VncDisplay *obj)
 {
@@ -1322,14 +1316,8 @@ static void do_size_request(VncDisplay *obj)
     if (priv->force_size) {
         int width = vnc_framebuffer_get_width(VNC_FRAMEBUFFER(priv->fb));
         int height = vnc_framebuffer_get_height(VNC_FRAMEBUFFER(priv->fb));
-        VNC_DEBUG("Setting size request %dx%d", width, height);
         gtk_widget_set_size_request(GTK_WIDGET(obj), width, height);
-
-        if (priv->allow_resize || priv->allow_scaling) {
-            g_idle_add(do_size_request_clear, obj);
-        }
     } else {
-        VNC_DEBUG("Clearing previous size request");
         gtk_widget_set_size_request(GTK_WIDGET(obj), -1, -1);
     }
 }


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