[Spice-devel] [PATCH spice-gtk 2/2] controllers: signal when a client is connected
Marc-André Lureau
marcandre.lureau at gmail.com
Wed Mar 21 15:07:03 PDT 2012
---
gtk/controller/controller.vala | 4 ++++
gtk/controller/foreign-menu.vala | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/gtk/controller/controller.vala b/gtk/controller/controller.vala
index b083f4e..c6cf984 100644
--- a/gtk/controller/controller.vala
+++ b/gtk/controller/controller.vala
@@ -46,6 +46,8 @@ public class Controller: Object {
public signal void show ();
public signal void hide ();
+ public signal void client_connected ();
+
public void menu_item_click_msg (int32 item_id) {
var msg = SpiceProtocol.Controller.MsgValue ();
msg.base.size = (uint32)sizeof (SpiceProtocol.Controller.MsgValue);
@@ -192,6 +194,8 @@ public class Controller: Object {
excl_connection = c;
}
+ client_connected ();
+
var t = new uint8[sizeof(SpiceProtocol.Controller.Msg)];
for (;;) {
read = yield c.input_stream.read_async (t[0:sizeof(SpiceProtocol.Controller.Msg)]);
diff --git a/gtk/controller/foreign-menu.vala b/gtk/controller/foreign-menu.vala
index 677e2ad..f2406bd 100644
--- a/gtk/controller/foreign-menu.vala
+++ b/gtk/controller/foreign-menu.vala
@@ -22,6 +22,8 @@ public class ForeignMenu: Object {
public Menu menu { get; private set; }
public string title { get; private set; }
+ public signal void client_connected ();
+
private int nclients;
private List<IOStream> clients;
@@ -153,6 +155,8 @@ public class ForeignMenu: Object {
read = yield c.input_stream.read_async (title[0:title_size]);
this.title = (string)title;
+ client_connected ();
+
var t = new uint8[sizeof(SpiceProtocol.ForeignMenu.Msg)];
for (;;) {
read = yield c.input_stream.read_async (t[0:sizeof(SpiceProtocol.ForeignMenu.Msg)]);
--
1.7.7.6
More information about the Spice-devel
mailing list