[Spice-devel] [PATCH spice-gtk 3/7] SpiceDisplay: Use SpiceGtkSession auto-clipboard value as default

Marc-André Lureau marcandre.lureau at gmail.com
Mon Oct 10 05:51:11 PDT 2011


This should rather be done in GObjectClass.constructed()


On Mon, Oct 10, 2011 at 2:34 PM, Hans de Goede <hdegoede at redhat.com> wrote:
> The auto-clipboard setting now lives in the SpiceGtkSession, if that
> was changed to FALSE (from the default of TRUE) and later another SpiceDisplay
> was created for this session that would change it back to TRUE again.
> This patch fixes this.
>
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  gtk/spice-widget.c |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
> index 06e5113..5678a81 100644
> --- a/gtk/spice-widget.c
> +++ b/gtk/spice-widget.c
> @@ -1659,8 +1659,16 @@ static void channel_destroy(SpiceSession *s, SpiceChannel *channel, gpointer dat
>  **/
>  SpiceDisplay *spice_display_new(SpiceSession *session, int id)
>  {
> -    return g_object_new(SPICE_TYPE_DISPLAY, "session", session,
> -                        "channel-id", id, NULL);
> +    gboolean auto_clipboard;
> +
> +    g_object_get(spice_gtk_session_get(session),
> +                 "auto-clipboard", &auto_clipboard, NULL);
> +
> +    return g_object_new(SPICE_TYPE_DISPLAY,
> +                        "session", session,
> +                        "channel-id", id,
> +                        "auto-clipboard", auto_clipboard,
> +                        NULL);
>  }
>
>  /**
> --
> 1.7.6.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>



-- 
Marc-André Lureau


More information about the Spice-devel mailing list