--- rxvt-unicode/src/command.C 2012/12/29 15:59:51 1.528 +++ rxvt-unicode/src/command.C 2012/12/31 12:05:34 1.532 @@ -1474,7 +1474,7 @@ if (bg_window_position_sensitive ()) { want_position_change = true; - if (!(bg_flags & BG_IS_VALID)) + if (bg_img == 0) moved = true; } #endif @@ -1531,19 +1531,14 @@ case MapNotify: #ifdef HAVE_BG_PIXMAP - /* This is needed specifically to fix the case of no window manager or a - * non-reparenting window manager. In those cases we never get first - * ConfigureNotify. Also that speeds startup under normal WM, by taking - * care of multiplicity of ConfigureNotify events arriving while WM does - * reparenting. - * We should not render background immediately, as there could be several - * ConfigureNotify's to follow. Lets take care of all of them in one scoop - * by scheduling background redraw as soon as we can, but giving a short - * bit of time for ConfigureNotifies to arrive. - * We should render background PRIOR to drawing any text, but AFTER all - * of ConfigureNotifys for the best results. - */ - if (!(bg_flags & BG_IS_VALID)) + // This is needed at startup for the case of no window manager + // or a non-reparenting window manager and also because we + // defer bg image updates if the window is not mapped. The + // short delay is to optimize for multiple ConfigureNotify + // events at startup when the window manager reparents the + // window, so as to perform the computation after we have + // received all of them. + if (bg_img == 0) update_background_ev.start (0.025); #endif mapped = 1; @@ -1861,8 +1856,11 @@ || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID]) { #if BG_IMAGE_FROM_ROOT - bg_set_root_pixmap (); - update_background (); + if (option (Opt_transparent)) + { + rxvt_img::new_from_root (this)->replace (root_img); + update_background (); + } #endif #if ENABLE_PERL HOOK_INVOKE ((this, HOOK_ROOTPMAP_CHANGE, DT_END));