--- rxvt-unicode/src/main.C 2007/12/24 06:51:37 1.291 +++ rxvt-unicode/src/main.C 2008/01/19 00:24:53 1.300 @@ -228,6 +228,10 @@ #endif delete fontset[0]; +#ifdef HAVE_BG_PIXMAP + bgPixmap.destroy (); +#endif + if (display) { selection_clear (); @@ -276,18 +280,10 @@ } clear (); - } - - delete [] pix_colors_focused; -#if OFF_FOCUS_FADING - delete [] pix_colors_unfocused; -#endif -#ifdef HAVE_BG_PIXMAP - bgPixmap.destroy (); -#endif - display->flush (); /* ideally .put should do this */ - displays.put (display); + display->flush (); /* ideally .put should do this */ + displays.put (display); + } scr_release (); @@ -518,6 +514,7 @@ #ifdef HAVE_BG_PIXMAP { bgPixmap.set_target (this); + bgPixmap.invalidate (); #ifdef ENABLE_TRANSPARENCY if (option (Opt_transparent)) @@ -588,6 +585,8 @@ XMapWindow (dpy, vt); XMapWindow (dpy, parent[0]); + + refresh_check (); } static struct sig_handlers @@ -1698,10 +1697,9 @@ 0L, 1L, False, XA_PIXMAP, &atype, &aformat, &nitems, &bytes_after, &prop); if (result == Success && prop && atype == XA_PIXMAP) - { - return *(Pixmap *)prop; - } + return *(Pixmap *)prop; } + return None; } @@ -1719,34 +1717,25 @@ void rxvt_term::update_background () { - bgPixmap.invalidate (); + if (update_background_ev.is_active ()) + return; - /* no chance of real time refresh if we are blurring! */ - if (bgPixmap.invalid_since + 0.50 < ev::now () - && !(bgPixmap.flags & bgPixmap_t::blurNeeded)) - { - update_background_ev.stop (); - bgPixmap.render (); - } - else - { - ev_tstamp refresh; + bgPixmap.invalidate (); - if (!bgPixmap.need_client_side_rendering ()) - refresh = .05; - else if (bgPixmap.flags & bgPixmap_t::blurNeeded) - refresh = .20; /* very slow !!! */ - else - refresh = .07; + ev_tstamp to_wait = 0.5 - (ev::now () - bgPixmap.valid_since); - update_background_ev.start (refresh); - } + if (to_wait <= 0.) + bgPixmap.render (); + else + update_background_ev.start (to_wait); } void rxvt_term::update_background_cb (ev::timer &w, int revents) { make_current (); + + update_background_ev.stop (); bgPixmap.render (); refresh_check (); }