summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-bg.c
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-11-11 07:03:08 +0200
committerJasmine Hassan <[email protected]>2012-11-11 19:35:36 +0200
commitbba859372d7035ccc7d67e846321d7ccc0742a6d (patch)
tree73dd9c38471e15a2be395b681fe2f6b92e7c898f /libmate-desktop/mate-bg.c
parentd8ad1966e4bc8745160386d704fe67c9000d4bb0 (diff)
downloadmate-desktop-bba859372d7035ccc7d67e846321d7ccc0742a6d.tar.bz2
mate-desktop-bba859372d7035ccc7d67e846321d7ccc0742a6d.tar.xz
[mate-bg] don't keep duplicates of cache width and height
http://git.gnome.org/browse/gnome-desktop/commit/?id=c5e5db705ee982e3cc0761a7c83235798d8428bd
Diffstat (limited to 'libmate-desktop/mate-bg.c')
-rw-r--r--libmate-desktop/mate-bg.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index 5252020..3cae227 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -102,9 +102,6 @@ struct _MateBG {
GdkColor primary;
GdkColor secondary;
- gint last_pixmap_width;
- gint last_pixmap_height;
-
GFileMonitor* file_monitor;
guint changed_id;
@@ -972,16 +969,13 @@ mate_bg_create_pixmap (MateBG *bg,
g_return_val_if_fail (bg != NULL, NULL);
g_return_val_if_fail (window != NULL, NULL);
- if (bg->last_pixmap_width != width ||
- bg->last_pixmap_height != height)
+ if (bg->pixbuf_cache &&
+ gdk_pixbuf_get_width (bg->pixbuf_cache) != width &&
+ gdk_pixbuf_get_height (bg->pixbuf_cache) != height)
{
- if (bg->pixbuf_cache) {
- g_object_unref (bg->pixbuf_cache);
- bg->pixbuf_cache = NULL;
- }
+ g_object_unref (bg->pixbuf_cache);
+ bg->pixbuf_cache = NULL;
}
- bg->last_pixmap_width = width;
- bg->last_pixmap_height = height;
/* has the side effect of loading and caching pixbuf only when in tile mode */
mate_bg_get_pixmap_size (bg, width, height, &pm_width, &pm_height);