diff options
author | Jasmine Hassan <[email protected]> | 2012-11-11 07:03:08 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-11-11 19:35:36 +0200 |
commit | bba859372d7035ccc7d67e846321d7ccc0742a6d (patch) | |
tree | 73dd9c38471e15a2be395b681fe2f6b92e7c898f | |
parent | d8ad1966e4bc8745160386d704fe67c9000d4bb0 (diff) | |
download | mate-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
-rw-r--r-- | libmate-desktop/mate-bg.c | 16 |
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); |