From bba859372d7035ccc7d67e846321d7ccc0742a6d Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sun, 11 Nov 2012 07:03:08 +0200 Subject: [mate-bg] don't keep duplicates of cache width and height http://git.gnome.org/browse/gnome-desktop/commit/?id=c5e5db705ee982e3cc0761a7c83235798d8428bd --- libmate-desktop/mate-bg.c | 16 +++++----------- 1 file 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); -- cgit v1.2.1