[Goodies-commits] r2912 - ristretto/trunk/src

Stephan Arts stephan at xfce.org
Fri Jul 13 12:56:30 CEST 2007


Author: stephan
Date: 2007-07-13 10:56:29 +0000 (Fri, 13 Jul 2007)
New Revision: 2912

Modified:
   ristretto/trunk/src/picture_viewer.c
Log:
fix background color

Modified: ristretto/trunk/src/picture_viewer.c
===================================================================
--- ristretto/trunk/src/picture_viewer.c	2007-07-13 07:08:10 UTC (rev 2911)
+++ ristretto/trunk/src/picture_viewer.c	2007-07-13 10:56:29 UTC (rev 2912)
@@ -202,10 +202,19 @@
 rstto_picture_viewer_paint(GtkWidget *widget)
 {
 	GdkPixbuf *pixbuf = RSTTO_PICTURE_VIEWER(widget)->dst_pixbuf;
+	GdkColor color;
+	color.pixel = 0;
+	color.red = 0;
+	color.green = 0;
+	color.blue = 0;
 	/* required for transparent pixbufs... add double buffering to fix flickering*/
 	if(GTK_WIDGET_REALIZED(widget))
 	{		  
 		GdkPixmap *buffer = gdk_pixmap_new(NULL, widget->allocation.width, widget->allocation.height, gdk_drawable_get_depth(widget->window));
+		GdkGC *gc = gdk_gc_new(GDK_DRAWABLE(buffer));
+
+		gdk_gc_set_foreground(gc, &color);
+		gdk_draw_rectangle(GDK_DRAWABLE(buffer), gc, TRUE, 0, 0, widget->allocation.width, widget->allocation.height);
 		if(pixbuf)
 		{
 			gdk_draw_pixbuf(GDK_DRAWABLE(buffer), 
@@ -219,16 +228,16 @@
 							gdk_pixbuf_get_height(pixbuf),
 			                GDK_RGB_DITHER_NONE,
 			                0,0);
-			gdk_draw_drawable(GDK_DRAWABLE(widget->window), 
-			                gdk_gc_new(widget->window), 
-			                buffer,
-			                0,
-			                0,
-							0,
-							0,
-							widget->allocation.width,
-							widget->allocation.height);
 		}
+		gdk_draw_drawable(GDK_DRAWABLE(widget->window), 
+		                gdk_gc_new(widget->window), 
+		                buffer,
+		                0,
+		                0,
+						0,
+						0,
+						widget->allocation.width,
+						widget->allocation.height);
 	}
 }
 




More information about the Goodies-commits mailing list