[gnome-boxes] spice-display: Allow connecting through FD



commit 9268e023c3747e552c8047cb05bac76e1328613a
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Nov 19 00:55:00 2014 +0000

    spice-display: Allow connecting through FD
    
    Make use of the new superclass API to allow users of this class to
    connect to display using a file descriptor.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738573

 src/spice-display.vala |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/spice-display.vala b/src/spice-display.vala
index 1872e56..309122c 100644
--- a/src/spice-display.vala
+++ b/src/spice-display.vala
@@ -204,6 +204,14 @@ private class Boxes.SpiceDisplay: Boxes.Display {
             channel_new_id = session.channel_new.connect ((channel) => {
                 var id = channel.channel_id;
 
+                if (open_fd != null)
+                    channel.open_fd.connect (() => {
+                        int fd;
+
+                        fd = open_fd ();
+                        channel.open_fd (fd);
+                    });
+
                 if (channel is Spice.MainChannel) {
                     main_channel = channel as Spice.MainChannel;
                     main_event_id = main_channel.channel_event.connect (main_event);
@@ -238,7 +246,10 @@ private class Boxes.SpiceDisplay: Boxes.Display {
             });
 
         session.password = password;
-        session.connect ();
+        if (open_fd != null)
+            session.open_fd (-1);
+        else
+            session.connect ();
     }
 
     public override void disconnect_it () {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]