[connections/fixes-from-gnome-41: 2/4] rdp-connection: Draw thumbnail on the app side
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [connections/fixes-from-gnome-41: 2/4] rdp-connection: Draw thumbnail on the app side
- Date: Mon, 4 Oct 2021 09:20:09 +0000 (UTC)
commit 7a0198593bd75ad8892eeb5cfccd1b82d3b0d390
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 d1bc319..7f1e3ec 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]