From 4bd51634a074456b84fbbed0f3149a15d091ad06 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 11 Feb 2011 12:38:46 +0000 Subject: [PATCH] background: Make update_size() work in _load() If we never got an initial frame, it wouldn't work too well. --- panels/background/cc-background-item.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/panels/background/cc-background-item.c b/panels/background/cc-background-item.c index 7042f6f13..14d5a4b68 100644 --- a/panels/background/cc-background-item.c +++ b/panels/background/cc-background-item.c @@ -307,7 +307,14 @@ cc_background_item_load (CcBackgroundItem *item, return FALSE; } - update_size (item); + /* FIXME we should handle XML files as well */ + if (item->priv->mime_type != NULL && + g_str_has_prefix (item->priv->mime_type, "image/")) { + gdk_pixbuf_get_file_info (item->priv->filename, + &item->priv->width, + &item->priv->height); + update_size (item); + } return TRUE; }