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, 18 insertions, 0 deletions
diff --git a/src/background.vala b/src/background.vala
index 6c94831..9a77047 100644
--- a/src/background.vala
+++ b/src/background.vala
@@ -681,7 +681,25 @@ public class Background : Gtk.Fixed
private BackgroundLoader load_background (string? filename)
{
if (filename == null)
+ {
filename = fallback_bgcolor;
+ } else
+ {
+ try
+ {
+ var file = File.new_for_path(filename);
+ var fileInfo = file.query_info(FileAttribute.ACCESS_CAN_READ, FileQueryInfoFlags.NONE, null);
+ if (!fileInfo.get_attribute_boolean(FileAttribute.ACCESS_CAN_READ))
+ {
+ debug ("Can't read background file %s, falling back to %s", filename, system_background);
+ filename = system_background;
+ }
+ }
+ catch
+ {
+ filename = system_background;
+ }
+ }
var b = loaders.lookup (filename);
if (b == null)