--- rxvt-unicode/src/main.C 2011/07/09 13:14:47 1.357 +++ rxvt-unicode/src/main.C 2012/01/09 15:30:17 1.364 @@ -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 ()); @@ -269,9 +269,6 @@ free (selection.text); free (selection.clip_text); - // TODO: manage env vars in child only(!) - free (env_display); - free (env_term); free (locale); free (v_buffer); @@ -708,6 +705,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; } /*----------------------------------------------------------------------*/ @@ -1080,7 +1086,7 @@ scr_reset (); #ifdef USE_XIM - IMSetPosition (); + im_set_position (); #endif } @@ -1151,7 +1157,7 @@ /* Checking whether input method is running. */ bool -rxvt_term::IMisRunning () +rxvt_term::im_is_running () { Atom atom; Window win; @@ -1177,7 +1183,7 @@ } void -rxvt_term::IMSendSpot () +rxvt_term::im_send_spot () { XPoint nspot; XVaNestedList preedit_attr; @@ -1293,7 +1299,7 @@ * open a suitable preedit type */ bool -rxvt_term::IM_get_IC (const char *modifiers) +rxvt_term::im_get_ic (const char *modifiers) { int i, j, found; XIM xim; @@ -1501,7 +1507,7 @@ vt_select_input (); #endif - IMSetPosition (); + im_set_position (); return true; } @@ -1539,7 +1545,7 @@ { strcpy (buf, "@im="); strncat (buf, s[i], IMBUFSIZ - 5); - if (IM_get_IC (buf)) + if (im_get_ic (buf)) { found = true; break; @@ -1554,11 +1560,11 @@ } /* try with XMODIFIERS env. var. */ - if (IM_get_IC ("")) + if (im_get_ic ("")) goto done; /* try with no modifiers base IF the user didn't specify an IM */ - if (IM_get_IC ("@im=none")) + if (im_get_ic ("@im=none")) goto done; done: @@ -1569,7 +1575,7 @@ } void -rxvt_term::IMSetPosition () +rxvt_term::im_set_position () { XRectangle preedit_rect, status_rect, *needed_rect; XVaNestedList preedit_attr, status_attr; @@ -1577,7 +1583,7 @@ if (!Input_Context || !focus || !(input_style & (XIMPreeditArea | XIMPreeditPosition)) - || !IMisRunning ()) + || !im_is_running ()) return; if (input_style & XIMPreeditPosition) @@ -1652,6 +1658,9 @@ bg_invalidate (); + if (!mapped) + return; + ev_tstamp to_wait = 0.5 - (ev::now () - bg_valid_since); if (to_wait <= 0.)