--- rxvt-unicode/src/main.C 2011/07/09 13:40:13 1.358 +++ rxvt-unicode/src/main.C 2011/08/21 20:13:58 1.361 @@ -107,7 +107,7 @@ } // check to see whether this combination already exists otherwise - for (cc = v.end (); cc-- > v.begin (); ) + for (cc = v.begin (); cc < v.end (); cc++) if (cc->c1 == c1 && cc->c2 == c2) return COMPOSE_LO + (cc - v.begin ()); @@ -708,6 +708,15 @@ ncol = width / fwidth; nrow = height / fheight; + + // When the size of the vt window is not a multiple of the cell + // size, i.e., when the wm does not honour our size hints, there are + // extra areas not covered by the terminal screen. Such gaps, when a + // bg pixmap is set, would have to be cleared manually to properly + // refresh the background. We take the simpler route and shrink the + // vt window so as to avoid creating gaps. + width = ncol * fwidth; + height = nrow * fheight; } /*----------------------------------------------------------------------*/ @@ -1652,6 +1661,9 @@ bg_invalidate (); + if (!mapped) + return; + ev_tstamp to_wait = 0.5 - (ev::now () - bg_valid_since); if (to_wait <= 0.)