--- rxvt-unicode/src/main.C 2007/08/03 22:40:10 1.239 +++ rxvt-unicode/src/main.C 2007/08/15 22:41:52 1.242 @@ -506,14 +506,55 @@ if (option (Opt_scrollBar)) resize_scrollbar (); /* create and map scrollbar */ #endif +#ifdef HAVE_BG_PIXMAP + { + bool changed = false; + bgPixmap.set_target (this); + #ifdef ENABLE_TRANSPARENCY - if (option (Opt_transparent)) - { - XSelectInput (dpy, display->root, PropertyChangeMask); - check_our_parents (); - rootwin_ev.start (display, display->root); - } + 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 (); + scr_touch (true); + } + } +#endif + #if ENABLE_PERL rootwin_ev.start (display, display->root); #endif @@ -1110,10 +1151,13 @@ window_vt_x, window_vt_y, width, height); - scr_clear (); #ifdef XPM_BACKGROUND - resize_pixmap (); + /* TODO: replace with update_pixmap() that should unify transparency and bg image handling ! */ + if (bgPixmap.window_size_sensitive ()) + bgPixmap.render (); #endif + + scr_clear (); } if (fix_screen || old_height == 0) @@ -1123,8 +1167,9 @@ //scr_touch (false); #ifdef HAVE_BG_PIXMAP - if (bgPixmap.pixmap) - scr_touch (false); +// 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