--- rxvt-unicode/src/background.C 2011/01/28 00:08:57 1.143 +++ rxvt-unicode/src/background.C 2011/02/21 07:40:59 1.147 @@ -3,7 +3,7 @@ *----------------------------------------------------------------------* * * All portions of code are copyright by their respective author/s. - * Copyright (c) 2005-2008 Marc Lehmann + * Copyright (c) 2005-2008 Marc Lehmann * Copyright (c) 2007 Sasha Vasko * Copyright (c) 2010 Emanuele Giaquinta * @@ -67,6 +67,10 @@ #ifdef HAVE_AFTERIMAGE if (original_asim) safe_asimage_destroy (original_asim); + if (asv) + destroy_asvisual (asv, 0); + if (asimman) + destroy_image_manager (asimman, 0); #endif #ifdef HAVE_PIXBUF @@ -101,7 +105,7 @@ # endif # ifdef BG_IMAGE_FROM_FILE - if (have_image) + if (bg_flags & BG_IS_FROM_FILE) { if (bg_flags & BG_IS_SIZE_SENSITIVE) return true; @@ -120,7 +124,7 @@ # endif # ifdef BG_IMAGE_FROM_FILE - if (have_image) + if (bg_flags & BG_IS_FROM_FILE) { if (bg_flags & BG_ROOT_ALIGN) return true; @@ -870,8 +874,7 @@ if (original_asim) safe_asimage_destroy (original_asim); original_asim = image; - bg_flags |= BG_CLIENT_RENDER; - have_image = true; + bg_flags |= BG_IS_FROM_FILE | BG_CLIENT_RENDER; return true; } # endif @@ -883,7 +886,7 @@ if (pixbuf) g_object_unref (pixbuf); pixbuf = image; - have_image = true; + bg_flags |= BG_IS_FROM_FILE; return true; } # endif @@ -942,27 +945,26 @@ return changed; } -static inline unsigned long -compute_tint_shade_flags (rxvt_color *tint, int shade) +void +rxvt_term::set_tint_shade_flags () { - unsigned long flags = 0; rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC); bool has_shade = shade != 100; - if (tint) + bg_flags &= ~BG_TINT_FLAGS; + + if (bg_flags & BG_TINT_SET) { - tint->get (c); + tint.get (c); if (!has_shade && (c.r <= 0x00ff || c.r >= 0xff00) && (c.g <= 0x00ff || c.g >= 0xff00) && (c.b <= 0x00ff || c.b >= 0xff00)) - flags |= rxvt_term::BG_TINT_BITAND; + bg_flags |= BG_TINT_BITAND; } - if (has_shade || tint) - flags |= rxvt_term::BG_NEEDS_TINT; - - return flags; + if (has_shade || (bg_flags & BG_TINT_SET)) + bg_flags |= BG_NEEDS_TINT; } bool @@ -970,9 +972,9 @@ { if (!(bg_flags & BG_TINT_SET) || tint != new_tint) { - unsigned long new_flags = compute_tint_shade_flags (&new_tint, shade); tint = new_tint; - bg_flags = (bg_flags & ~BG_TINT_FLAGS) | new_flags | BG_TINT_SET; + bg_flags |= BG_TINT_SET; + set_tint_shade_flags (); return true; } @@ -990,9 +992,8 @@ if (new_shade != shade) { - unsigned long new_flags = compute_tint_shade_flags ((bg_flags & BG_TINT_SET) ? &tint : NULL, new_shade); shade = new_shade; - bg_flags = (bg_flags & ~BG_TINT_FLAGS) | new_flags; + set_tint_shade_flags (); return true; } @@ -1352,7 +1353,7 @@ # endif # ifdef BG_IMAGE_FROM_FILE - if (have_image + if ((bg_flags & BG_IS_FROM_FILE) || (tr_flags & BG_EFFECTS_FLAGS)) { if (render_image (tr_flags))