aboutsummaryrefslogtreecommitdiff
path: root/src/background.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/background.vala')
-rw-r--r--src/background.vala18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/background.vala b/src/background.vala
index 967e9f9..0c722e8 100644
--- a/src/background.vala
+++ b/src/background.vala
@@ -439,14 +439,16 @@ public class Background : Gtk.Fixed
width = height = 0;
try
{
- var image = new Gdk.Pixbuf.from_file (filename);
- width = image.width;
- height = image.height;
- var surface = new Cairo.Surface.similar (target_surface, Cairo.Content.COLOR_ALPHA, image.width, image.height);
- var c = new Cairo.Context (surface);
- Gdk.cairo_set_source_pixbuf (c, image, 0, 0);
- c.paint ();
- return surface;
+ if (filename != "") {
+ var image = new Gdk.Pixbuf.from_file (filename);
+ width = image.width;
+ height = image.height;
+ var surface = new Cairo.Surface.similar (target_surface, Cairo.Content.COLOR_ALPHA, image.width, image.height);
+ var c = new Cairo.Context (surface);
+ Gdk.cairo_set_source_pixbuf (c, image, 0, 0);
+ c.paint ();
+ return surface;
+ }
}
catch (Error e)
{