[Spice-devel] [PATCH spice-gtk V3 3/3] file-xfer: disable drag-n-dop when agent is not connected

Dunrong Huang riegamaths at gmail.com
Tue Dec 4 20:22:25 PST 2012


Signed-off-by: Dunrong Huang <riegamaths at gmail.com>
---
 gtk/channel-main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index b2253a6..95f46c2 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -2443,6 +2443,13 @@ static void file_xfer_send_start_msg(gpointer data, gpointer user_data)
 
 gboolean spice_main_file_xfer(SpiceMainChannel *channel, GList *files, GError *err)
 {
+    SpiceMainChannelPrivate *c = channel->priv;
+
+    if (!c->agent_connected) {
+        SPICE_DEBUG("spice agent is not connected, file xfer is disable now");
+        return FALSE;
+    }
+
     /* Send VD_AGENT_FILE_XFER_START message to guest for every file */
     g_list_foreach(files, file_xfer_send_start_msg, channel);
     g_list_free_full(files, g_free);
-- 
1.8.0



More information about the Spice-devel mailing list