[Spice-devel] [PATCH spice-gtk] widget: apply color conversion when creating image

Hans de Goede hdegoede at redhat.com
Tue Oct 16 04:50:06 PDT 2012


Looks good, ACK.

On 10/16/2012 01:10 PM, Marc-André Lureau wrote:
> The color conversion only happened during "invalidate", but we also
> need to apply it when the image is created in the first place.
>
> This solves initial screen being black after connection to agent-less
> guest with 16b colour depth:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=843134
> ---
>   gtk/spice-widget.c | 16 ++++++++++++++--
>   1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
> index 13d7111..4832afd 100644
> --- a/gtk/spice-widget.c
> +++ b/gtk/spice-widget.c
> @@ -1512,11 +1512,22 @@ static gboolean configure_event(GtkWidget *widget, GdkEventConfigure *conf)
>       return true;
>   }
>
> +static void update_image(SpiceDisplay *display)
> +{
> +    SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
> +
> +    spicex_image_create(display);
> +    if (d->convert)
> +        do_color_convert(display, &d->area);
> +}
> +
>   static void realize(GtkWidget *widget)
>   {
> +    SpiceDisplay *display = SPICE_DISPLAY(widget);
> +
>       GTK_WIDGET_CLASS(spice_display_parent_class)->realize(widget);
>
> -    spicex_image_create(SPICE_DISPLAY(widget));
> +    update_image(display);
>   }
>
>   static void unrealize(GtkWidget *widget)
> @@ -1865,7 +1876,8 @@ static void update_area(SpiceDisplay *display,
>       spicex_image_destroy(display);
>       d->area = area;
>       if (gtk_widget_get_realized(GTK_WIDGET(display)))
> -        spicex_image_create(display);
> +        update_image(display);
> +
>       update_size_request(display);
>
>       set_monitor_ready(display, true);
>


More information about the Spice-devel mailing list