--- rxvt-unicode/src/main.C 2011/12/06 11:29:52 1.362 +++ rxvt-unicode/src/main.C 2012/01/19 13:33:43 1.369 @@ -38,9 +38,9 @@ #include -#include -#include -#include +#include +#include +#include #include @@ -49,7 +49,7 @@ # include #else # ifdef HAVE_SETLOCALE -# include +# include # endif #endif @@ -199,8 +199,6 @@ #ifdef KEYSYM_RESOURCE keyboard = new keyboard_manager; #endif - - // this->envv = 0; } // clean up the most important stuff, do *not* call x or free mem etc. @@ -271,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); @@ -357,7 +352,7 @@ } void -rxvt_term::set_option (uint8_t opt, bool set) +rxvt_term::set_option (uint8_t opt, bool set) NOTHROW { if (!opt) return; @@ -717,8 +712,8 @@ // 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; + vt_width = ncol * fwidth; + vt_height = nrow * fheight; } /*----------------------------------------------------------------------*/ @@ -736,8 +731,8 @@ ws.ws_col = ncol; ws.ws_row = nrow; - ws.ws_xpixel = width; - ws.ws_ypixel = height; + ws.ws_xpixel = vt_width; + ws.ws_ypixel = vt_height; ioctl (pty->pty, TIOCSWINSZ, &ws); #if 0 @@ -951,13 +946,14 @@ /* * find if fg/bg matches any of the normal (low-intensity) colors */ -void -rxvt_term::set_colorfgbg () +char * +rxvt_term::get_colorfgbg () { unsigned int i; const char *xpmb = ""; char fstr[] = "default"; char bstr[] = "default"; + char *env_colorfgbg; for (i = Color_Black; i <= Color_White; i++) if (pix_colors[Color_fg] == pix_colors[i]) @@ -976,7 +972,9 @@ break; } + env_colorfgbg = (char *)rxvt_malloc (sizeof ("COLORFGBG=default;default;bg")); sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr); + return env_colorfgbg; } /*----------------------------------------------------------------------*/ @@ -1079,7 +1077,7 @@ XMoveResizeWindow (dpy, vt, window_vt_x, window_vt_y, - width, height); + vt_width, vt_height); #ifdef HAVE_BG_PIXMAP if (bg_window_size_sensitive ()) @@ -1114,7 +1112,7 @@ newheight = wattr.height - szHint.base_height; } - if (newwidth != width || newheight != height) + if (newwidth != vt_width || newheight != vt_height) { newwidth += szHint.base_width; newheight += szHint.base_height; @@ -1572,7 +1570,7 @@ if (im_get_ic ("@im=none")) goto done; -done: +done: ; #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) if (rs[Rs_imLocale]) SET_LOCALE (locale);