--- rxvt-unicode/src/main.C 2007/06/23 18:29:08 1.236 +++ rxvt-unicode/src/main.C 2007/08/20 20:13:35 1.246 @@ -150,11 +150,11 @@ rxvt_term::rxvt_term () : -#if TRANSPARENT || ENABLE_PERL +#if ENABLE_TRANSPARENCY || ENABLE_PERL rootwin_ev (this, &rxvt_term::rootwin_cb), #endif -#if TRANSPARENT - check_our_parents_ev(this, &rxvt_term::check_our_parents_cb), +#if HAVE_BG_PIXMAP + update_background_ev(this, &rxvt_term::update_background_cb), #endif #ifdef HAVE_SCROLLBARS scrollbar_ev (this, &rxvt_term::x_cb), @@ -336,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 (); @@ -506,14 +506,50 @@ 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 + { + 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]); + + 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 (); + + if (bgPixmap.set_file (rs[Rs_backgroundPixmap])) + if (!option (Opt_transparent)) + update_background (); + } +#endif + } #endif + #if ENABLE_PERL rootwin_ev.start (display, display->root); #endif @@ -1110,10 +1146,12 @@ window_vt_x, window_vt_y, width, height); - scr_clear (); #ifdef XPM_BACKGROUND - resize_pixmap (); + if (bgPixmap.window_size_sensitive ()) + update_background (); #endif + + scr_clear (); } if (fix_screen || old_height == 0) @@ -1122,9 +1160,10 @@ // TODO, with nvidia-8178, resizes kill the alpha channel, report if not fixed in newer version //scr_touch (false); -#ifdef XPM_BACKGROUND - if (pixmap) - scr_touch (false); +#ifdef HAVE_BG_PIXMAP +// TODO: this don't seem to have any effect - do we still need it ? If so - in which case exactly ? +// if (bgPixmap.pixmap) +// scr_touch (false); #endif #ifdef USE_XIM