[Spice-devel] [PATCH spice-gtk 3/7] SpiceDisplay: Use SpiceGtkSession auto-clipboard value as default

Hans de Goede hdegoede at redhat.com
Mon Oct 10 05:34:40 PDT 2011


The auto-clipboard setting now lives in the SpiceGtkSession, if that
was changed to FALSE (from the default of TRUE) and later another SpiceDisplay
was created for this session that would change it back to TRUE again.
This patch fixes this.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 gtk/spice-widget.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 06e5113..5678a81 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -1659,8 +1659,16 @@ static void channel_destroy(SpiceSession *s, SpiceChannel *channel, gpointer dat
  **/
 SpiceDisplay *spice_display_new(SpiceSession *session, int id)
 {
-    return g_object_new(SPICE_TYPE_DISPLAY, "session", session,
-                        "channel-id", id, NULL);
+    gboolean auto_clipboard;
+
+    g_object_get(spice_gtk_session_get(session),
+                 "auto-clipboard", &auto_clipboard, NULL);
+
+    return g_object_new(SPICE_TYPE_DISPLAY,
+                        "session", session,
+                        "channel-id", id,
+                        "auto-clipboard", auto_clipboard,
+                        NULL);
 }
 
 /**
-- 
1.7.6.4



More information about the Spice-devel mailing list