1521
1521
p_width = gdk_pixbuf_get_width(bg);
1522
1522
p_height = gdk_pixbuf_get_height(bg);
1524
1524
scale = (double)monitor_geometry.width/p_width;
1525
1525
height = p_height * scale;
1526
1526
width = monitor_geometry.width;
1528
1528
if (height < monitor_geometry.height)
1530
1530
scale = (double)monitor_geometry.height/p_height;
1531
1531
height = monitor_geometry.height;
1536
1535
GdkPixbuf *p = gdk_pixbuf_scale_simple (bg, width,
1537
1536
height, GDK_INTERP_BILINEAR);
1538
1537
if (width > monitor_geometry.width)
1540
1539
p = gdk_pixbuf_new_subpixbuf(p, (width-monitor_geometry.width)/2, 0, monitor_geometry.width, monitor_geometry.height);
1543
p = gdk_pixbuf_add_alpha (p, FALSE, 255, 255, 255);
1543
p = gdk_pixbuf_add_alpha (p, FALSE, 255, 255, 255);
1544
1545
gdk_cairo_set_source_pixbuf (c, p, monitor_geometry.x, monitor_geometry.y);