[Spice-devel] [spice-gtk v1 1/2] Deprecate “color-depth” properties

Victor Toso victortoso at redhat.com
Fri Dec 14 14:42:37 UTC 2018


Hi,

On Wed, Dec 12, 2018 at 05:46:57PM +0100, Christophe Fergeau wrote:
> On Tue, Dec 11, 2018 at 01:48:14PM +0100, Victor Toso wrote:
> > @@ -297,8 +296,8 @@ static void spice_main_get_property(GObject    *object,
> >      case PROP_DISPLAY_DISABLE_ANIMATION:
> >          g_value_set_boolean(value, c->display_disable_animation);
> >          break;
> > -    case PROP_DISPLAY_COLOR_DEPTH:
> > -        g_value_set_uint(value, c->display_color_depth);
> > +    case PROP_DISPLAY_COLOR_DEPTH: /* FIXME: deprecated */
> > +        g_value_set_uint(value, 32);
> 
> This deserves a warning too I think.

Ok

> > @@ -551,11 +547,19 @@ static void spice_main_channel_class_init(SpiceMainChannelClass *klass)
> >                                G_PARAM_CONSTRUCT |
> >                                G_PARAM_STATIC_STRINGS));
> >  
> > +    /**
> > +     * SpiceMainChannel:color-depth:
> > +     *
> > +     * Deprecated: 0.36: Deprecated due lack of support in drivers, only Windows 7 and older.
> > +     * This option is currently ignored.
> 
> "due to lack of support"

Thanks, fixed

> > @@ -667,8 +666,8 @@ static void spice_session_get_property(GObject    *gobject,
> >      case PROP_SECURE_CHANNELS:
> >          g_value_set_boxed(value, s->secure_channels);
> >          break;
> > -    case PROP_COLOR_DEPTH:
> > -        g_value_set_int(value, s->color_depth);
> > +    case PROP_COLOR_DEPTH: /* FIXME: deprecated */
> > +        g_value_set_int(value, 0);
> 
> Why not 32? I'd add a warning too.

That's the default of the property, "0" means "don't set it".

> Acked-by: Christophe Fergeau <cfergeau at redhat.com>
> hopefully not too many people are using it.
> 
> Christophe

Indeed. I'll send a v2 later Today.

Cheers,
Victor
 
> >          break;
> >      case PROP_AUDIO:
> >          g_value_set_boolean(value, s->audio);
> > @@ -808,7 +807,7 @@ static void spice_session_set_property(GObject      *gobject,
> >          s->secure_channels = g_value_dup_boxed(value);
> >          break;
> >      case PROP_COLOR_DEPTH:
> > -        s->color_depth = g_value_get_int(value);
> > +        spice_info("SpiceSession::color-depth has been deprecated. Property is ignored");
> >          break;
> >      case PROP_AUDIO:
> >          s->audio = g_value_get_boolean(value);
> > @@ -1106,6 +1105,9 @@ static void spice_session_class_init(SpiceSessionClass *klass)
> >       * Display color depth to set on new display channels. If 0, don't set.
> >       *
> >       * Since: 0.7
> > +     *
> > +     * Deprecated: 0.36: Deprecated due lack of support in drivers, only Windows 7 and older.
> > +     * This option is currently ignored.
> >       **/
> >      g_object_class_install_property
> >          (gobject_class, PROP_COLOR_DEPTH,
> > @@ -1113,6 +1115,7 @@ static void spice_session_class_init(SpiceSessionClass *klass)
> >                            "Color depth",
> >                            "Display channel color depth",
> >                            0, 32, 0,
> > +                          G_PARAM_DEPRECATED |
> >                            G_PARAM_READWRITE |
> >                            G_PARAM_STATIC_STRINGS));
> >  
> > @@ -2224,8 +2227,6 @@ void spice_session_channel_new(SpiceSession *session, SpiceChannel *channel)
> >                       "disable-font-smooth", all || spice_strv_contains(s->disable_effects, "font-smooth"),
> >                       "disable-animation", all || spice_strv_contains(s->disable_effects, "animation"),
> >                       NULL);
> > -        if (s->color_depth != 0)
> > -            g_object_set(channel, "color-depth", s->color_depth, NULL);
> >  
> >          CHANNEL_DEBUG(channel, "new main channel, switching");
> >          s->cmain = channel;
> > -- 
> > 2.19.2
> > 
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/spice-devel


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20181214/bac6f32f/attachment.sig>


More information about the Spice-devel mailing list