--- rxvt-unicode/src/main.C 2004/12/13 01:29:03 1.119 +++ rxvt-unicode/src/main.C 2005/02/03 07:18:30 1.132 @@ -34,7 +34,8 @@ #include "rxvt.h" /* NECESSARY */ #include "main.intpro" /* PROTOS for internal routines */ -#include +#include +#include #ifdef TTY_GID_SUPPORT # include @@ -44,7 +45,9 @@ # include #endif -#include +#ifdef KEYSYM_RESOURCE +# include "keyboard.h" +#endif vector rxvt_term::termlist; @@ -158,6 +161,7 @@ im_ev (this, &rxvt_term::im_cb), #endif sw_term (this, &rxvt_term::sig_term), + sw_int (this, &rxvt_term::sig_term), sw_chld (this, &rxvt_term::sig_chld), termwin_ev (this, &rxvt_term::x_cb), vt_ev (this, &rxvt_term::x_cb), @@ -170,6 +174,13 @@ cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; termlist.push_back (this); + +#ifdef KEYSYM_RESOURCE + keyboard = new keyboard_manager; + + if (!keyboard) + rxvt_fatal ("out of memory, aborting.\n"); +#endif } rxvt_term::~rxvt_term () @@ -179,12 +190,12 @@ if (cmd_pid) kill (-cmd_pid, SIGHUP); - pty.put (); - #ifdef UTMP_SUPPORT privileged_utmp (RESTORE); #endif + pty.put (); + #if ENABLE_STYLES for (int i = RS_styleCount; --i; ) if (TermWin.fontset[i] != TermWin.fontset[0]) @@ -261,10 +272,15 @@ free (env_term); free (env_colorfgbg); free (locale); + free (v_buffer); free (incr_buf); delete envv; delete argv; + +#ifdef KEYSYM_RESOURCE + delete keyboard; +#endif } void @@ -332,6 +348,8 @@ { SET_R (this); + set_locale (""); + if (!init_vars ()) return false; @@ -339,7 +357,9 @@ const char **cmd_argv = init_resources (argc, argv); - set_locale (""); +#ifdef KEYSYM_RESOURCE + keyboard->register_done (); +#endif #if MENUBAR_MAX menubar_read (rs[Rs_menu]); @@ -383,6 +403,8 @@ init_command (cmd_argv); + free (cmd_argv); + pty_ev.start (pty.pty, EVENT_READ); check_ev.start (); @@ -783,6 +805,7 @@ TermWin.fontset[0] = fs; prop = (*fs)[1]->properties (); + prop.height += TermWin.lineSpace; fs->set_prop (prop); TermWin.fwidth = prop.width; @@ -861,7 +884,7 @@ { set_string_property (XA_WM_NAME, str); #if ENABLE_FRILLS - set_utf8_property (display->atom ("_NET_WM_NAME"), str); + set_utf8_property (xa[XA_NET_WM_NAME], str); #endif } @@ -870,7 +893,7 @@ { set_string_property (XA_WM_ICON_NAME, str); #if ENABLE_FRILLS - set_utf8_property (display->atom ("_NET_WM_ICON_NAME"), str); + set_utf8_property (xa[XA_NET_WM_ICON_NAME], str); #endif } @@ -999,10 +1022,6 @@ } /*----------------------------------------------------------------------*/ -/* - * Colour determination for low colour displays, routine from - * Hans de Goede - */ int rxvt_term::rXParseAllocColor (rxvt_color *screen_in_out, const char *colour) @@ -1099,6 +1118,7 @@ XMoveResizeWindow (display->display, TermWin.vt, window_vt_x, window_vt_y, TermWin_TotalWidth (), TermWin_TotalHeight ()); + scr_clear (); #ifdef XPM_BACKGROUND resize_pixmap (); @@ -1131,6 +1151,11 @@ old_width = szHint.width; old_height = szHint.height; +#ifdef XPM_BACKGROUND + if (TermWin.pixmap) + scr_touch (false); +#endif + #ifdef USE_XIM IMSetStatusPosition (); #endif @@ -1369,7 +1394,7 @@ TermWin.fheight + 1, TermWin.fheight - 1, TermWin.fheight - 2, TermWin.fheight + 2); - fs = XCreateFontSet (display->display, pat, + fs = XCreateFontSet (display->display, rs[Rs_imFont] ? rs[Rs_imFont] : pat, &missing_charset_list, &missing_charset_count, &def_string); if (missing_charset_list)