[Spice-devel] [spice-gtk 1/5] port: send opened a port-event signal on init

Christophe Fergeau cfergeau at redhat.com
Tue Feb 4 05:42:34 PST 2014


ACK

On Wed, Jan 22, 2014 at 07:26:47PM +0100, Marc-André Lureau wrote:
> From: Marc-André Lureau <marcandre.lureau at redhat.com>
> 
> If the port is already opened, emit a "opened" port-event on init. This
> simplifies user code to only handle port events.
> ---
>  gtk/channel-port.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/gtk/channel-port.c b/gtk/channel-port.c
> index 11948bb..0a8b37f 100644
> --- a/gtk/channel-port.c
> +++ b/gtk/channel-port.c
> @@ -249,9 +249,12 @@ static void port_handle_init(SpiceChannel *channel, SpiceMsgIn *in)
>      g_return_if_fail(c->name == NULL);
>  
>      c->name = g_strdup((gchar*)init->name);
> -    g_object_notify(G_OBJECT(channel), "port-name");
>  
>      port_set_opened(self, init->opened);
> +    if (init->opened)
> +        emit_main_context(channel, SPICE_PORT_EVENT, SPICE_PORT_EVENT_OPENED);
> +
> +    g_object_notify_main_context(G_OBJECT(channel), "port-name");
>  }
>  
>  /* coroutine context */
> -- 
> 1.8.4.2
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20140204/68432c7d/attachment.pgp>


More information about the Spice-devel mailing list