--- rxvt-unicode/src/main.C 2005/12/18 00:59:42 1.149 +++ rxvt-unicode/src/main.C 2005/12/31 17:16:17 1.154 @@ -33,6 +33,8 @@ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ +#include + #include #include @@ -289,6 +291,15 @@ } void +rxvt_term::child_exit () +{ + cmd_pid = 0; + + if (!OPTION (Opt_hold)) + destroy (); +} + +void rxvt_term::destroy () { if (destroy_ev.active) @@ -460,7 +471,7 @@ menubar_read (rs[Rs_menu]); #endif #ifdef HAVE_SCROLLBARS - if (options & Opt_scrollBar) + if (OPTION (Opt_scrollBar)) scrollBar.setIdle (); /* set existence for size calculations */ #endif @@ -477,7 +488,7 @@ #endif #ifdef HAVE_SCROLLBARS - if (options & Opt_scrollBar) + if (OPTION (Opt_scrollBar)) resize_scrollbar (); /* create and map scrollbar */ #endif #if (MENUBAR_MAX) @@ -485,7 +496,7 @@ XMapWindow (disp, menuBar.win); #endif #ifdef TRANSPARENT - if (options & Opt_transparent) + if (OPTION (Opt_transparent)) { XSelectInput (disp, display->root, PropertyChangeMask); check_our_parents (); @@ -522,7 +533,7 @@ for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++) if (pid == (*t)->cmd_pid) { - (*t)->destroy (); + (*t)->child_exit (); break; } } @@ -672,7 +683,7 @@ void rxvt_term::privileged_utmp (rxvt_privaction action) { - if ((options & Opt_utmpInhibit) + if (OPTION (Opt_utmpInhibit) || !pty.name || !*pty.name) return; @@ -720,13 +731,13 @@ if (flags & WidthValue) { - ncol = BOUND_POSITIVE_INT16 (w); + ncol = clamp (w, 0, std::numeric_limits::max ()); szHint.flags |= USSize; } if (flags & HeightValue) { - nrow = BOUND_POSITIVE_INT16 (h); + nrow = clamp (h, 0, std::numeric_limits::max ()); szHint.flags |= USSize; } @@ -774,7 +785,7 @@ { sb_w = scrollbar_TotalWidth (); szHint.base_width += sb_w; - if (!(options & Opt_scrollBar_right)) + if (!OPTION (Opt_scrollBar_right)) window_vt_x += sb_w; } @@ -797,7 +808,7 @@ } else { - MIN_IT (width, max_width); + min_it (width, max_width); szHint.width = szHint.base_width + width; } @@ -808,11 +819,11 @@ } else { - MIN_IT (height, max_height); + min_it (height, max_height); szHint.height = szHint.base_height + height; } - if (scrollbar_visible () && (options & Opt_scrollBar_right)) + if (scrollbar_visible () && OPTION (Opt_scrollBar_right)) window_sb_x = szHint.width - sb_w; if (recalc_x) @@ -891,8 +902,6 @@ fwidth = prop.width; fheight = prop.height; - fweight = prop.weight; - fslant = prop.slant; fbase = (*fs)[1]->ascent; for (int style = 1; style < 4; style++) @@ -937,7 +946,6 @@ void rxvt_term::set_string_property (Atom prop, const char *str, int len) { - // TODO: SMART_WINDOW_TITLE XChangeProperty (display->display, parent[0], prop, XA_STRING, 8, PropModeReplace, (const unsigned char *)str, len >= 0 ? len : strlen (str)); @@ -945,7 +953,6 @@ void rxvt_term::set_utf8_property (Atom prop, const char *str, int len) { - // TODO: SMART_WINDOW_TITLE wchar_t *ws = rxvt_mbstowcs (str, len); char *s = rxvt_wcstoutf8 (ws);