--- rxvt-unicode/src/background.C 2007/12/18 11:15:24 1.19 +++ rxvt-unicode/src/background.C 2007/12/24 06:51:37 1.20 @@ -781,6 +781,7 @@ flags = (flags & ~tintFlags) | new_flags | tintSet; return true; } + return false; } @@ -794,6 +795,7 @@ flags = (flags&~tintFlags)|new_flags; return true; } + return false; } @@ -803,7 +805,7 @@ int new_shade = (shade_str) ? atoi (shade_str) : 0; if (new_shade < 0 && new_shade > -100) - new_shade = 200 - (100 + new_shade); + new_shade = 200 - (100 + new_shade); else if (new_shade == 100) new_shade = 0; @@ -814,6 +816,7 @@ flags = (flags & (~tintFlags | tintSet)) | new_flags; return true; } + return false; } @@ -913,6 +916,7 @@ success = true; } } + XDestroyWindow (dpy, src); XUngrabServer (dpy); //fprintf (stderr, "%s:%d: ev_count = %d\n", __FUNCTION__, __LINE__, ev_count); @@ -1042,6 +1046,7 @@ XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, window_width, window_height); result |= transpPmapTinted; } + XRenderFreePicture (dpy, mask_pic); XRenderFreePicture (dpy, overlay_pic); XRenderFreePicture (dpy, back_pic); @@ -1073,9 +1078,7 @@ bool bgPixmap_t::set_root_pixmap () { - Pixmap new_root_pixmap = None; - - new_root_pixmap = target->get_pixmap_property (XA_XROOTPMAP_ID); + Pixmap new_root_pixmap = target->get_pixmap_property (XA_XROOTPMAP_ID); if (new_root_pixmap == None) new_root_pixmap = target->get_pixmap_property (XA_ESETROOT_PMAP_ID); @@ -1084,6 +1087,7 @@ root_pixmap = new_root_pixmap; return true; } + return false; } # endif /* ENABLE_TRANSPARENCY */ @@ -1092,7 +1096,6 @@ static void ShadeXImage(rxvt_term *term, XImage* srcImage, int shade, int rm, int gm, int bm); # endif - bool bgPixmap_t::render () { @@ -1183,9 +1186,10 @@ } # endif /* HAVE_AFTERIMAGE */ - if (result != NULL) + if (result) { GC gc = XCreateGC (target->dpy, target->vt, 0UL, NULL); + if (gc) { if (/*pmap_depth != target->depth &&*/ pixmap != None) @@ -1193,13 +1197,15 @@ XFreePixmap (target->dpy, pixmap); pixmap = None; } + if (pixmap == None) { pixmap = XCreatePixmap (target->dpy, target->vt, result->width, result->height, target->depth); - pmap_width = result->width; + pmap_width = result->width; pmap_height = result->height; - pmap_depth = target->depth; + pmap_depth = target->depth; } + if (pmap_depth != result->depth) { /* Bad Match error will ensue ! stupid X !!!! */ @@ -1212,11 +1218,14 @@ /* TODO: implement image recoding */ } } + if (pmap_depth == result->depth) XPutImage (target->dpy, pixmap, gc, result, 0, 0, 0, 0, result->width, result->height); + XFreeGC (target->dpy, gc); flags = flags & ~isInvalid; } + XDestroyImage (result); } @@ -1252,7 +1261,7 @@ } void -bgPixmap_t::apply() +bgPixmap_t::apply () { if (target) {