Blame SOURCES/vinagre-3.22.0-share-clipboard.patch

624986
From e3b5eef0476a5c5a7e11f4d433ffd586497b73cb Mon Sep 17 00:00:00 2001
624986
From: Marek Kasik <mkasik@redhat.com>
624986
Date: Wed, 7 Jun 2017 17:21:36 +0200
624986
Subject: [PATCH] Fix "Share clipboard" functionality in Spice plugin
624986
624986
Set "auto-clipboard" property on correct class. The correct one is SpiceDisplay
624986
for spice-gtk <= 0.31 and SpiceGtkSession for spice-gtk > 0.31.
624986
624986
https://bugzilla.gnome.org/show_bug.cgi?id=783517
624986
---
624986
 configure.ac                      |  4 +++-
624986
 plugins/spice/vinagre-spice-tab.c | 17 ++++++++++++++++-
624986
 2 files changed, 19 insertions(+), 2 deletions(-)
624986
624986
diff --git a/configure.ac b/configure.ac
624986
index 0dfc0db..5b51a82 100644
624986
--- a/configure.ac
624986
+++ b/configure.ac
624986
@@ -91,7 +91,9 @@ AC_ARG_ENABLE([spice],
624986
 AS_IF([test "x$enable_spice" != "xno"],
624986
   [PKG_CHECK_MODULES([SPICE],
624986
     [$SPICE_DEPS],
624986
-    [have_spice=yes],
624986
+    [have_spice=yes
624986
+     PKG_CHECK_EXISTS(spice-client-gtk-3.0 >= 0.32,
624986
+       [AC_DEFINE([HAVE_SPICE_CLIENT_GTK_0_32], [1], [Spice Client Gtk 3.0 library is of version 0.32 or newer])], [])],
624986
     [have_spice=no])],
624986
   [have_spice=no])
624986
 
624986
diff --git a/plugins/spice/vinagre-spice-tab.c b/plugins/spice/vinagre-spice-tab.c
624986
index 3365ee1..657a66f 100644
624986
--- a/plugins/spice/vinagre-spice-tab.c
624986
+++ b/plugins/spice/vinagre-spice-tab.c
624986
@@ -379,9 +379,16 @@ create_spice_display (VinagreSpiceTab *spice_tab, int id)
624986
 		"grab-keyboard", TRUE,
624986
 		"grab-mouse", TRUE,
624986
 		"resize-guest", resize_guest,
624986
-		"auto-clipboard", auto_clipboard,
624986
 		"scaling", scaling,
624986
 		NULL);
624986
+
624986
+#ifdef HAVE_SPICE_CLIENT_GTK_0_32
624986
+  g_object_set (spice_gtk_session_get (spice_tab->priv->spice),
624986
+#else
624986
+  g_object_set (d->display,
624986
+#endif
624986
+		"auto-clipboard", auto_clipboard,
624986
+		NULL);
624986
   /* TODO: add view-only here when spice-gtk ready */
624986
 
624986
   g_object_get (spice_tab->priv->spice, "uri", &name, NULL); /* TODO: a better friendly name? */
624986
@@ -735,7 +742,11 @@ vinagre_spice_tab_set_auto_clipboard (VinagreSpiceTab *tab, gboolean active)
624986
 {
624986
   g_return_if_fail (VINAGRE_IS_SPICE_TAB (tab));
624986
 
624986
+#ifdef HAVE_SPICE_CLIENT_GTK_0_32
624986
+  g_object_set (spice_gtk_session_get (tab->priv->spice), "auto-clipboard", active, NULL);
624986
+#else
624986
   g_object_set (tab->priv->display, "auto-clipboard", active, NULL);
624986
+#endif
624986
 }
624986
 
624986
 gboolean
624986
@@ -745,7 +756,11 @@ vinagre_spice_tab_get_auto_clipboard (VinagreSpiceTab *tab)
624986
 
624986
   g_return_val_if_fail (VINAGRE_IS_SPICE_TAB (tab), FALSE);
624986
 
624986
+#ifdef HAVE_SPICE_CLIENT_GTK_0_32
624986
+  g_object_get (spice_gtk_session_get (tab->priv->spice), "auto-clipboard", &active, NULL);
624986
+#else
624986
   g_object_get (tab->priv->display, "auto-clipboard", &active, NULL);
624986
+#endif
624986
 
624986
   return active;
624986
 }
624986
-- 
624986
2.13.5
624986