[Spice-commits] gtk/spice-widget.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Tue Oct 16 05:01:44 PDT 2012


 gtk/spice-widget.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

New commits:
commit a006d45ca3c969b5495d875d8240ad25f4aae628
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Oct 16 13:08:11 2012 +0200

    widget: apply color conversion when creating image
    
    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

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-commits mailing list