--- rxvt-unicode/src/main.C 2007/06/09 13:04:27 1.234 +++ rxvt-unicode/src/main.C 2007/08/10 22:10:36 1.240 @@ -150,8 +150,10 @@ rxvt_term::rxvt_term () : -#if TRANSPARENT || ENABLE_PERL +#if ENABLE_TRANSPARENCY || ENABLE_PERL rootwin_ev (this, &rxvt_term::rootwin_cb), +#endif +#if ENABLE_TRANSPARENCY check_our_parents_ev(this, &rxvt_term::check_our_parents_cb), #endif #ifdef HAVE_SCROLLBARS @@ -334,7 +336,7 @@ #if HAVE_SCROLLBARS scrollbar_ev.stop (display); #endif -#if TRANSPARENT || ENABLE_PERL +#if ENABLE_TRANSPARENCY || ENABLE_PERL rootwin_ev.stop (display); #endif incr_ev.stop (); @@ -504,14 +506,55 @@ if (option (Opt_scrollBar)) resize_scrollbar (); /* create and map scrollbar */ #endif -#ifdef TRANSPARENT - if (option (Opt_transparent)) - { - XSelectInput (dpy, display->root, PropertyChangeMask); - check_our_parents (); - rootwin_ev.start (display, display->root); - } +#ifdef HAVE_BG_PIXMAP + { + bool changed = false; + bgPixmap.set_target (this); + +#ifdef ENABLE_TRANSPARENCY + if (option (Opt_transparent)) + { + bgPixmap.set_transparent (); +#ifdef HAVE_AFTERIMAGE + if (rs [Rs_blurradius]) + bgPixmap.set_blur_radius (rs [Rs_blurradius]); +#endif + if (ISSET_PIXCOLOR (Color_tint)) + bgPixmap.set_tint (pix_colors_focused [Color_tint]); + if (rs [Rs_shade]) + bgPixmap.set_shade (rs [Rs_shade]); + changed = true; + + bgPixmap.set_root_pixmap (); + XSelectInput (dpy, display->root, PropertyChangeMask); + rootwin_ev.start (display, display->root); + } +#endif + +#ifdef XPM_BACKGROUND + if (rs[Rs_backgroundPixmap] != NULL) + { + const char *p = rs[Rs_backgroundPixmap]; + + if ((p = strchr (p, ';')) != NULL) + { + p++; + bgPixmap.set_geometry (p); + } + else + bgPixmap.set_defaultGeometry (); + + changed = bgPixmap.set_file (rs[Rs_backgroundPixmap]); + } #endif + if (changed) + { + bgPixmap.render_background (); + scr_touch (true); + } + } +#endif + #if ENABLE_PERL rootwin_ev.start (display, display->root); #endif @@ -630,7 +673,7 @@ /*----------------------------------------------------------------------*/ /* - * window size/position calculcations for XSizeHint and other storage. + * window size/position calculations for XSizeHint and other storage. * if width/height are non-zero then override calculated width/height */ void @@ -1110,7 +1153,8 @@ scr_clear (); #ifdef XPM_BACKGROUND - resize_pixmap (); + /* TODO: should that really be here ? */ + bgPixmap.render_background (); #endif } @@ -1120,8 +1164,8 @@ // TODO, with nvidia-8178, resizes kill the alpha channel, report if not fixed in newer version //scr_touch (false); -#ifdef XPM_BACKGROUND - if (pixmap) +#ifdef HAVE_BG_PIXMAP + if (bgPixmap.pixmap) scr_touch (false); #endif