[virt-tools-list] [PATCH virt-viewer 2/3] spice: implement can-auto-resize

Marc-André Lureau marcandre.lureau at gmail.com
Wed Mar 12 16:42:03 UTC 2014


Always return TRUE for Spice displays. See rationale in method comment.
---
 src/virt-viewer-display-spice.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-spice.c
index d13fbda..81ce6de 100644
--- a/src/virt-viewer-display-spice.c
+++ b/src/virt-viewer-display-spice.c
@@ -56,6 +56,7 @@ static GdkPixbuf *virt_viewer_display_spice_get_pixbuf(VirtViewerDisplay *displa
 static void virt_viewer_display_spice_release_cursor(VirtViewerDisplay *display);
 static void virt_viewer_display_spice_close(VirtViewerDisplay *display G_GNUC_UNUSED);
 static gboolean virt_viewer_display_spice_selectable(VirtViewerDisplay *display);
+static gboolean virt_viewer_display_spice_can_auto_resize(VirtViewerDisplay *display);
 
 static void
 virt_viewer_display_spice_finalize(GObject *obj)
@@ -80,6 +81,7 @@ virt_viewer_display_spice_class_init(VirtViewerDisplaySpiceClass *klass)
     dclass->release_cursor = virt_viewer_display_spice_release_cursor;
     dclass->close = virt_viewer_display_spice_close;
     dclass->selectable = virt_viewer_display_spice_selectable;
+    dclass->can_auto_resize = virt_viewer_display_spice_can_auto_resize;
 
     g_type_class_add_private(klass, sizeof(VirtViewerDisplaySpicePrivate));
 }
@@ -335,6 +337,18 @@ virt_viewer_display_spice_selectable(VirtViewerDisplay *self)
     return agent_connected;
 }
 
+static gboolean
+virt_viewer_display_spice_can_auto_resize(VirtViewerDisplay *self G_GNUC_UNUSED)
+{
+    /*
+     * with xorg driver and windows, it needs the Spice agent but with
+     * drm/kms driver, it is no longer required, however it requires
+     * gnome-settings-daemon (or a similar service).  There is no easy
+     * way to guess all that from client side, just assume it is
+     * working:
+     */
+    return TRUE;
+}
 
 /*
  * Local variables:
-- 
1.8.5.3




More information about the virt-tools-list mailing list