[connections/gnome-41] rdp-connection: Draw thumbnail on the app side



commit 3396d498d755b5ae9acc91c7b3c28164e57a85e2
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Oct 1 11:25:40 2021 +0200

    rdp-connection: Draw thumbnail on the app side
    
    Instead of using the broken mechanism in gtk-frdp (To be fixed).
    
    Fixes https://github.com/flathub/org.gnome.Connections/issue/4

 src/rdp-connection.vala | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/rdp-connection.vala b/src/rdp-connection.vala
index 7c520a9..0df38dd 100644
--- a/src/rdp-connection.vala
+++ b/src/rdp-connection.vala
@@ -38,7 +38,14 @@ namespace Connections {
             }
 
             owned get {
-                return display.get_pixbuf ();
+                Gtk.Allocation alloc;
+                widget.get_allocation (out alloc);
+
+                var surface = new Cairo.ImageSurface (ARGB32, alloc.width, alloc.height);
+                var context = new Cairo.Context (surface);
+                widget.draw (context);
+
+                return Gdk.pixbuf_get_from_surface (surface, 0, 0, alloc.width, alloc.height);
             }
         }
 


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