[connections/wip/scale-mode: 1/2] vnc-connection: Default scaling to "fit-window"




commit 37cd6538938aa1c04acd59bf28b9ae4e381170f3
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue May 11 17:13:13 2021 +0200

    vnc-connection: Default scaling to "fit-window"

 src/vnc-connection.vala | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)
---
diff --git a/src/vnc-connection.vala b/src/vnc-connection.vala
index b8ea99f..bc4a586 100644
--- a/src/vnc-connection.vala
+++ b/src/vnc-connection.vala
@@ -87,7 +87,6 @@ namespace Connections {
             display.set_keyboard_grab (true);
             display.set_pointer_grab (true);
             display.set_force_size (false);
-            display.set_scaling (true);
 
             window = new Gtk.Window ();
             window.add (display);
@@ -207,20 +206,8 @@ namespace Connections {
             if (!display.is_open ())
                 return;
 
-            // Get the allocated size of the parent container
-            Gtk.Allocation alloc;
-            display.get_parent ().get_allocation (out alloc);
-            if (display.get_width () > alloc.width) {
-                display.width_request = alloc.width;
-
-                display.height_request = (alloc.width * display.height) / display.width;
-            }
-
-            if (display.get_height () > alloc.height) {
-                display.height_request = alloc.height;
-
-                display.width_request = (alloc.height * display.width) / display.height;
-            }
+            display.scaling = display.hexpand = true;
+            display.width_request = display.height_request = 0;
         }
     }
 }


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