--- rxvt-unicode/src/init.C 2003/11/25 15:25:17 1.4 +++ rxvt-unicode/src/init.C 2003/11/27 10:12:10 1.8 @@ -1,7 +1,7 @@ /*--------------------------------*-C-*---------------------------------* * File: init.c *----------------------------------------------------------------------* - * $Id: init.C,v 1.4 2003/11/25 15:25:17 pcg Exp $ + * $Id: init.C,v 1.8 2003/11/27 10:12:10 pcg Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1992 John Bovey, University of Kent at Canterbury @@ -386,7 +386,7 @@ cmd_pid = -1; cmd_fd = tty_fd = Xfd = -1; PrivateModes = SavedModes = PrivMode_Default; - TermWin.focus = 1; + TermWin.focus = 0; TermWin.ncol = 80; TermWin.nrow = 24; TermWin.int_bwidth = INTERNALBORDERWIDTH; @@ -475,6 +475,7 @@ close(i); } dup2(STDERR_FILENO, STDOUT_FILENO); +#if 0 // schmorp sayz closing filies is murder for (i = STDERR_FILENO + 1; i < R->num_fds; i++) { #ifdef __sgi /* Alex Coventry says we need 4 & 7 too */ if (i == 4 || i == 7) @@ -482,6 +483,7 @@ #endif close(i); } +#endif } /*----------------------------------------------------------------------*/ @@ -1079,10 +1081,6 @@ XCMAP = DefaultColormap(R->Xdisplay, Xscreen); XVISUAL = DefaultVisual(R->Xdisplay, Xscreen); -#ifdef POINTER_BLANK - static rxvt_color blackcolour; - blackcolour.set (r, 0, 0, 0); -#endif if (R->Options & Opt_transparent) { XGetWindowAttributes(R->Xdisplay, RootWindow(R->Xdisplay, Xscreen), &gattr); @@ -1166,13 +1164,20 @@ #if defined(HAVE_SCROLLBARS) || defined(MENUBAR) /* cursor (menuBar/scrollBar): Black-on-White */ - R->pointer_leftptr = XCreateFontCursor(R->Xdisplay, XC_left_ptr); + R->leftptr_cursor = XCreateFontCursor(R->Xdisplay, XC_left_ptr); #endif #ifdef POINTER_BLANK - R->pointer_blank = XCreateGlyphCursor(R->Xdisplay, R->TermWin.font->fid, - R->TermWin.font->fid, ' ', ' ', - &blackcolour, &blackcolour); + { + XColor blackcolour; + blackcolour.red = 0; + blackcolour.green = 0; + blackcolour.blue = 0; + Font f = XLoadFont (R->Xdisplay, "fixed"); + R->blank_cursor = XCreateGlyphCursor (R->Xdisplay, f, f, ' ', ' ', + &blackcolour, &blackcolour); + XUnloadFont (R->Xdisplay, f); + } #endif /* the vt window */ @@ -1186,7 +1191,9 @@ #ifdef DEBUG_X XStoreName(R->Xdisplay, R->TermWin.vt, "vt window"); #endif - rxvt_pointer_unblank(aR); + + R->pointer_unblank (); + vt_emask = (ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask); #ifdef POINTER_BLANK @@ -1296,27 +1303,8 @@ else #endif er = -1; - rxvt_get_ttymode(&(R->tio), er); -/* install exit handler for cleanup */ -#ifdef HAVE_ATEXIT - atexit(rxvt_clean_exit); -#else -# ifdef HAVE_ON_EXIT - on_exit(rxvt_clean_exit, NULL); /* non-ANSI exit handler */ -# endif -#endif - - signal(SIGHUP, rxvt_Exit_signal); -#ifndef __svr4__ - signal(SIGINT, rxvt_Exit_signal); -#endif - signal(SIGQUIT, rxvt_Exit_signal); - signal(SIGTERM, rxvt_Exit_signal); - signal(SIGCHLD, rxvt_Child_signal); - -/* need to trap SIGURG for SVR4 (Unixware) rlogin */ -/* signal (SIGURG, SIG_DFL); */ + rxvt_get_ttymode(&(R->tio), er); #ifndef __QNX__ /* spin off the command interpreter */ @@ -1410,17 +1398,17 @@ } /* reset signals and spin off the command interpreter */ - signal(SIGINT, SIG_DFL); - signal(SIGQUIT, SIG_DFL); - signal(SIGCHLD, SIG_DFL); + signal (SIGINT, SIG_DFL); + signal (SIGQUIT, SIG_DFL); + signal (SIGCHLD, SIG_DFL); /* * mimick login's behavior by disabling the job control signals * a shell that wants them can turn them back on */ #ifdef SIGTSTP - signal(SIGTSTP, SIG_IGN); - signal(SIGTTIN, SIG_IGN); - signal(SIGTTOU, SIG_IGN); + signal (SIGTSTP, SIG_IGN); + signal (SIGTTIN, SIG_IGN); + signal (SIGTTOU, SIG_IGN); #endif /* SIGTSTP */ /* set window size */