Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release-src > by-pkgid > 9ec37d859a7713de62bd171a0fde787a > files > 7

lxlauncher-0.2.1-3mdv2010.1.src.rpm

diff -p -up lxlauncher-0.2/src/lxlauncher.c.main_bg_pixmap lxlauncher-0.2/src/lxlauncher.c
--- lxlauncher-0.2/src/lxlauncher.c.main_bg_pixmap	2008-10-17 16:35:26.000000000 +0200
+++ lxlauncher-0.2/src/lxlauncher.c	2008-10-17 16:31:14.000000000 +0200
@@ -220,7 +220,9 @@ static gboolean on_viewport_expose( GtkW
 
     if( GTK_WIDGET_DRAWABLE(w) && evt->window == ((GtkViewport*)w)->bin_window )
     {
-      if (!pixmap) {
+      GtkStyle* main_style = gtk_widget_get_style(main_window);
+      GdkPixmap* main_pixmap = main_style->bg_pixmap[GTK_STATE_NORMAL];
+      if (!pixmap && !main_pixmap) {
         cairo_t *cr;
         cairo_pattern_t* pat;
 
@@ -240,10 +242,14 @@ static gboolean on_viewport_expose( GtkW
         cairo_destroy(cr);
       } else {
         GdkGC* gc = gdk_gc_new(evt->window);
+        gint x = 0, y = 0;
 
-        gdk_gc_set_tile( gc, pixmap );
+        gdk_gc_set_tile( gc, main_pixmap ? main_pixmap : pixmap );
         gdk_gc_set_fill( gc, GDK_TILED );
-        gdk_gc_set_ts_origin( gc, 0, 0 );
+        if (main_pixmap) {
+            gtk_widget_translate_coordinates(w, main_window, 0, 0, &x, &y);
+        }
+        gdk_gc_set_ts_origin( gc, -x, -y );
 
         gdk_draw_rectangle( evt->window, gc, TRUE, evt->area.x, evt->area.y, evt->area.width, evt->area.height );