[Spice-commits] 3 commits - gtk/channel-display.c gtk/controller

Marc-André Lureau elmarco at kemper.freedesktop.org
Thu Mar 22 06:26:31 PDT 2012


 gtk/channel-display.c            |    6 +-----
 gtk/controller/controller.vala   |   10 +++++++++-
 gtk/controller/foreign-menu.vala |    4 ++++
 3 files changed, 14 insertions(+), 6 deletions(-)

New commits:
commit 6db275a422013a34247b805923f88b23db850ea1
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Mar 21 19:18:38 2012 +0100

    Always release shm of primary surfaces
    
    Always remove shared memory segment of primary surfaces when
    destroying its canvas.

diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index 152d6a7..8269705 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -705,6 +705,7 @@ static void destroy_canvas(display_surface *surface)
 #ifdef HAVE_SYS_SHM_H
     else {
         shmdt(surface->data);
+        shmctl(surface->shmid, IPC_RMID, 0);
     }
 #endif
     surface->shmid = -1;
@@ -815,11 +816,6 @@ static void display_handle_mode(SpiceChannel *channel, SpiceMsgIn *in)
     surface->size    = surface->height * surface->stride;
     surface->primary = true;
     create_canvas(channel, surface);
-#ifdef HAVE_SYS_SHM_H
-    if (surface->shmid != -1) {
-        shmctl(surface->shmid, IPC_RMID, 0);
-    }
-#endif
 }
 
 /* coroutine context */
commit 3ff7d1f6969cd867ff86554f6c97c425ed0c1e63
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Mar 21 23:06:41 2012 +0100

    controllers: signal when a client is connected

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)]);
commit f1a65e78c895097f3f2c09c0f187a9b399ddc19e
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Mar 21 23:05:43 2012 +0100

    controller: handle SEND_CAD message as a property

diff --git a/gtk/controller/controller.vala b/gtk/controller/controller.vala
index 12b5b8d..b083f4e 100644
--- a/gtk/controller/controller.vala
+++ b/gtk/controller/controller.vala
@@ -40,6 +40,7 @@ public class Controller: Object {
 	public string[] disable_channels { private set; get; }
 	public SpiceCtrl.Menu? menu  { private set; get; }
 	public bool enable_smartcard { private set; get; }
+	public bool send_cad { private set; get; }
 
 	public signal void do_connect ();
 	public signal void show ();
@@ -131,7 +132,10 @@ public class Controller: Object {
 			menu = null;
 			break;
 
-		// ignore SEND_CAD
+		case SpiceProtocol.Controller.MsgId.SEND_CAD:
+			send_cad = (bool)v.value;
+			break;
+
 		case SpiceProtocol.Controller.MsgId.HOTKEYS:
 			hotkeys = str;
 			break;


More information about the Spice-commits mailing list