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

Dunrong Huang riegamaths at gmail.com
Fri Nov 23 03:11:40 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 3ea3958..efbed15 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -2447,6 +2447,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, drag-n-dop is disable now");
+        return FALSE;
+    }
+
     /* Send VD_AGENT_FILE_XFER_START message 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