diff --git a/app/xterm/MANIFEST b/app/xterm/MANIFEST index a51ffbf28..255c8b02d 100644 --- a/app/xterm/MANIFEST +++ b/app/xterm/MANIFEST @@ -1,4 +1,4 @@ -MANIFEST for xterm-236, version xterm-236 +MANIFEST for xterm-237, version xterm-237 -------------------------------------------------------------------------------- MANIFEST this file 256colres.h resource-definitions for 256-color mode diff --git a/app/xterm/charproc.c b/app/xterm/charproc.c index 1426b14c6..be9408a1f 100644 --- a/app/xterm/charproc.c +++ b/app/xterm/charproc.c @@ -1,4 +1,4 @@ -/* $XTermId: charproc.c,v 1.848 2008/07/27 19:00:21 tom Exp $ */ +/* $XTermId: charproc.c,v 1.852 2008/09/14 21:27:54 tom Exp $ */ /* @@ -505,6 +505,7 @@ static XtResource resources[] = #if OPT_BLINK_CURS Bres(XtNcursorBlink, XtCCursorBlink, screen.cursor_blink, False), #endif + Bres(XtNcursorUnderline, XtCCursorUnderline, screen.cursor_underline, False), #if OPT_BLINK_TEXT Bres(XtNshowBlinkAsBold, XtCCursorBlink, screen.blink_as_bold, DEFBLINKASBOLD), @@ -3635,21 +3636,12 @@ HandleStructNotify(Widget w GCC_UNUSED, if (event->xconfigure.window == XtWindow(toplevel)) { int height, width; - /* - * Some window managers modify the configuration during - * initialization. Skip notification events that we know are - * obsolete because there is already another in the queue. - */ - do { - height = event->xconfigure.height; - width = event->xconfigure.width; - TRACE(("HandleStructNotify(ConfigureNotify) %d,%d %dx%d\n", - event->xconfigure.y, event->xconfigure.x, - event->xconfigure.height, event->xconfigure.width)); + height = event->xconfigure.height; + width = event->xconfigure.width; + TRACE(("HandleStructNotify(ConfigureNotify) %d,%d %dx%d\n", + event->xconfigure.y, event->xconfigure.x, + event->xconfigure.height, event->xconfigure.width)); - } while (XCheckTypedWindowEvent(XtDisplay(xw), - event->xconfigure.window, - ConfigureNotify, event)); #if OPT_TOOLBAR /* * The notification is for the top-level widget, but we care about @@ -5119,9 +5111,9 @@ VTClassInit(void) #define init_Bres(name) \ TRACE(("init " #name " = %s\n", \ BtoS(wnew->name = request->name))) -#define init_Dres(name) \ - TRACE(("init " #name " = %f\n", \ - wnew->name = request->name)) +#define init_Dres2(name,i) \ + TRACE(("init " #name "[%d] = %f\n", i, \ + wnew->name[i] = request->name[i])) #define init_Ires(name) \ TRACE(("init " #name " = %d\n", \ wnew->name = request->name)) @@ -5129,15 +5121,20 @@ VTClassInit(void) TRACE(("init " #name " = \"%s\"\n", \ (wnew->name = x_strtrim(request->name)) != NULL \ ? wnew->name : "")) +#define init_Sres2(name,i) \ + TRACE(("init " #name "[%d] = \"%s\"\n", i, \ + (wnew->name(i) = x_strtrim(request->name(i))) != NULL \ + ? wnew->name(i) : "")) #define init_Tres(offset) \ TRACE(("init screen.Tcolors[" #offset "] = %#lx\n", \ fill_Tres(wnew, request, offset))) #else -#define init_Bres(name) wnew->name = request->name -#define init_Dres(name) wnew->name = request->name -#define init_Ires(name) wnew->name = request->name -#define init_Sres(name) wnew->name = x_strtrim(request->name) -#define init_Tres(offset) fill_Tres(wnew, request, offset) +#define init_Bres(name) wnew->name = request->name +#define init_Dres2(name,i) wnew->name[i] = request->name[i] +#define init_Ires(name) wnew->name = request->name +#define init_Sres(name) wnew->name = x_strtrim(request->name) +#define init_Sres2(name,i) wnew->name(i) = x_strtrim(request->name(i)) +#define init_Tres(offset) fill_Tres(wnew, request, offset) #endif #if OPT_COLOR_RES @@ -5456,6 +5453,7 @@ VTInitialize(Widget wrequest, init_Ires(screen.blink_off); wnew->screen.cursor_blink_res = wnew->screen.cursor_blink; #endif + init_Bres(screen.cursor_underline); #if OPT_BLINK_TEXT init_Ires(screen.blink_as_bold); #endif @@ -5583,7 +5581,7 @@ VTInitialize(Widget wrequest, init_Bres(misc.tiXtraScroll); init_Bres(misc.dynamicColors); for (i = fontMenu_font1; i <= fontMenu_lastBuiltin; i++) { - init_Sres(screen.MenuFontName(i)); + init_Sres2(screen.MenuFontName, i); } wnew->screen.MenuFontName(fontMenu_default) = wnew->misc.default_font.f_n; wnew->screen.MenuFontName(fontMenu_fontescape) = NULL; @@ -5799,7 +5797,7 @@ VTInitialize(Widget wrequest, #if OPT_RENDERFONT for (i = 0; i <= fontMenu_lastBuiltin; ++i) { - init_Dres(misc.face_size[i]); + init_Dres2(misc.face_size, i); } init_Sres(misc.face_name); init_Sres(misc.face_wide_name); @@ -6064,12 +6062,12 @@ VTDestroy(Widget w GCC_UNUSED) #ifndef NO_ACTIVE_ICON releaseWindowGCs(xw, &(screen->iconVwin)); #endif - XtUninstallTranslations((Widget)xw); + XtUninstallTranslations((Widget) xw); XtUninstallTranslations(screen->scrollWidget); #if OPT_TOOLBAR - XtUninstallTranslations((Widget)XtParent(xw)); + XtUninstallTranslations((Widget) XtParent(xw)); #endif - XtUninstallTranslations((Widget)SHELL_OF(xw)); + XtUninstallTranslations((Widget) SHELL_OF(xw)); if (screen->hidden_cursor) XFreeCursor(screen->display, screen->hidden_cursor); @@ -6893,7 +6891,7 @@ ShowCursor(void) * whether the window has focus, since in that case we want just an * outline for the cursor. */ - filled = (screen->select || screen->always_highlight); + filled = (screen->select || screen->always_highlight) && !screen->cursor_underline; #if OPT_HIGHLIGHT_COLOR use_selbg = isNotForeground(xw, fg_pix, bg_pix, selbg_pix); use_selfg = isNotBackground(xw, fg_pix, bg_pix, selfg_pix); @@ -7014,7 +7012,10 @@ ShowCursor(void) outlineGC = currentGC; screen->box->x = x; - screen->box->y = y; + if (!screen->cursor_underline) + screen->box->y = y; + else + screen->box->y = y + FontHeight(screen) - 2; XDrawLines(screen->display, VWindow(screen), outlineGC, screen->box, NBOX, CoordModePrevious); } diff --git a/app/xterm/fontutils.c b/app/xterm/fontutils.c index d7dec3a47..1c2e11917 100644 --- a/app/xterm/fontutils.c +++ b/app/xterm/fontutils.c @@ -1,4 +1,4 @@ -/* $XTermId: fontutils.c,v 1.272 2008/04/17 23:23:37 tom Exp $ */ +/* $XTermId: fontutils.c,v 1.275 2008/09/14 22:21:14 tom Exp $ */ /************************************************************ @@ -1335,12 +1335,16 @@ xtermSetCursorBox(TScreen * screen) { static XPoint VTbox[NBOX]; XPoint *vp; + int fw = FontWidth(screen) - 1; + int fh = FontHeight(screen) - 1; + int hh = screen->cursor_underline ? 1 : fh; vp = &VTbox[1]; - (vp++)->x = FontWidth(screen) - 1; - (vp++)->y = FontHeight(screen) - 1; - (vp++)->x = -(FontWidth(screen) - 1); - vp->y = -(FontHeight(screen) - 1); + (vp++)->x = fw; + (vp++)->y = hh; + (vp++)->x = -fw; + vp->y = -hh; + screen->box = VTbox; } @@ -1668,6 +1672,7 @@ xtermComputeFontInfo(XtermWidget xw, #endif /* OPT_RENDERWIDE */ } if (norm == 0) { + TRACE(("...no TrueType font found for number %d, disable menu entry\n", fontnum)); xw->misc.render_font = False; update_font_renderfont(); /* now we will fall through into the bitmap fonts */ @@ -2325,6 +2330,27 @@ lookupFontSizes(XtermWidget xw) } } +#if OPT_RENDERFONT +#define NMENU_RENDERFONTS (NMENUFONTS - 2) /* no selection or escape */ +static Boolean +useFaceSizes(XtermWidget xw) +{ + Boolean result = False; + int n; + + if (UsingRenderFont(xw)) { + result = True; + for (n = 0; n < NMENU_RENDERFONTS; ++n) { + if (xw->misc.face_size[n] <= 0.0) { + result = False; + break; + } + } + } + return result; +} +#endif + /* * Find the index of a larger/smaller font (according to the sign of 'relative' * and its magnitude), starting from the 'old' index. @@ -2335,34 +2361,65 @@ lookupRelativeFontSize(XtermWidget xw, int old, int relative) TScreen *screen = TScreenOf(xw); int n, m = -1; + TRACE(("lookupRelativeFontSize(old=%d, relative=%d)\n", old, relative)); if (!IsIcon(screen)) { - lookupFontSizes(xw); - if (relative != 0) { - for (n = 0; n < NMENUFONTS; ++n) { - if (screen->menu_font_sizes[n] > 0 && - screen->menu_font_sizes[n] != screen->menu_font_sizes[old]) { - int cmp_0 = ((screen->menu_font_sizes[n] > - screen->menu_font_sizes[old]) - ? relative - : -relative); - int cmp_m = ((m < 0) - ? 1 - : ((screen->menu_font_sizes[n] < - screen->menu_font_sizes[m]) - ? relative - : -relative)); - if (cmp_0 > 0 && cmp_m > 0) { - m = n; +#if OPT_RENDERFONT + if (useFaceSizes(xw)) { + TRACE(("...using FaceSize\n")); + if (relative != 0) { + for (n = 0; n < NMENU_RENDERFONTS; ++n) { + if (xw->misc.face_size[n] > 0 && + xw->misc.face_size[n] != xw->misc.face_size[old]) { + int cmp_0 = ((xw->misc.face_size[n] > + xw->misc.face_size[old]) + ? relative + : -relative); + int cmp_m = ((m < 0) + ? 1 + : ((xw->misc.face_size[n] < + xw->misc.face_size[m]) + ? relative + : -relative)); + if (cmp_0 > 0 && cmp_m > 0) { + m = n; + } } } } - if (m >= 0) { - if (relative > 1) - m = lookupRelativeFontSize(xw, m, relative - 1); - else if (relative < -1) - m = lookupRelativeFontSize(xw, m, relative + 1); + } else +#endif + { + TRACE(("...using bitmap areas\n")); + lookupFontSizes(xw); + if (relative != 0) { + for (n = 0; n < NMENUFONTS; ++n) { + if (screen->menu_font_sizes[n] > 0 && + screen->menu_font_sizes[n] != + screen->menu_font_sizes[old]) { + int cmp_0 = ((screen->menu_font_sizes[n] > + screen->menu_font_sizes[old]) + ? relative + : -relative); + int cmp_m = ((m < 0) + ? 1 + : ((screen->menu_font_sizes[n] < + screen->menu_font_sizes[m]) + ? relative + : -relative)); + if (cmp_0 > 0 && cmp_m > 0) { + m = n; + } + } + } } } + TRACE(("...new index %d\n", m)); + if (m >= 0) { + if (relative > 1) + m = lookupRelativeFontSize(xw, m, relative - 1); + else if (relative < -1) + m = lookupRelativeFontSize(xw, m, relative + 1); + } } return m; } diff --git a/app/xterm/input.c b/app/xterm/input.c index c039ec378..3883a227c 100644 --- a/app/xterm/input.c +++ b/app/xterm/input.c @@ -1,4 +1,4 @@ -/* $XTermId: input.c,v 1.299 2008/04/20 20:27:18 tom Exp $ */ +/* $XTermId: input.c,v 1.300 2008/09/14 16:37:25 Ted.Phelps Exp $ */ /* * Copyright 1999-2007,2008 by Thomas E. Dickey @@ -1262,6 +1262,7 @@ Input(XtermWidget xw, evt_state &= ~xw->misc.alt_mods; if (screen->alt_sends_esc) { TRACE(("...input-char is modified by ALT\n")); + eightbit = False; prefix = ANSI_ESC; } else if (!eightbit) { TRACE(("...input-char is shifted by ALT\n")); diff --git a/app/xterm/main.c b/app/xterm/main.c index 4f801b4d9..43af0f2af 100644 --- a/app/xterm/main.c +++ b/app/xterm/main.c @@ -1,4 +1,4 @@ -/* $XTermId: main.c,v 1.587 2008/05/26 18:25:54 Marius.Tolzmann Exp $ */ +/* $XTermId: main.c,v 1.588 2008/09/14 15:20:31 Paul.Lampert Exp $ */ /* * W A R N I N G @@ -1041,6 +1041,8 @@ static XrmOptionDescRec optionDescList[] = { {"-lcc", "*localeFilter",XrmoptionSepArg, (caddr_t) NULL}, {"-en", "*locale", XrmoptionSepArg, (caddr_t) NULL}, #endif +{"-uc", "*cursorUnderLine", XrmoptionNoArg, (caddr_t) "on"}, +{"+uc", "*cursorUnderLine", XrmoptionNoArg, (caddr_t) "off"}, {"-ulc", "*colorULMode", XrmoptionNoArg, (caddr_t) "off"}, {"+ulc", "*colorULMode", XrmoptionNoArg, (caddr_t) "on"}, {"-ulit", "*italicULMode", XrmoptionNoArg, (caddr_t) "off"}, @@ -1211,6 +1213,7 @@ static OptionHelp xtermOptions[] = { { "-/+lc", "turn on/off locale mode using luit" }, { "-lcc path", "filename of locale converter (" DEFLOCALEFILTER ")" }, #endif +{ "-/+uc", "turn on/off underline cursor" }, { "-/+ulc", "turn off/on display of underline as color" }, { "-/+ulit", "turn off/on display of underline as italics" }, #ifdef HAVE_UTMP diff --git a/app/xterm/os2main.c b/app/xterm/os2main.c index ad07c5c58..e3b09a247 100644 --- a/app/xterm/os2main.c +++ b/app/xterm/os2main.c @@ -1,4 +1,4 @@ -/* $XTermId: os2main.c,v 1.255 2007/11/30 01:25:03 tom Exp $ */ +/* $XTermId: os2main.c,v 1.256 2008/09/14 19:37:07 tom Exp $ */ /* removed all foreign stuff to get the code more clear (hv) * and did some rewrite for the obscure OS/2 environment @@ -198,13 +198,13 @@ static struct termio d_tio; * POSIX termios has termios.c_cc, which is similar to SVR4. */ #define TTYMODE(name) { name, sizeof(name)-1, 0, 0 } -static int override_tty_modes = 0; +static Boolean override_tty_modes = False; /* *INDENT-OFF* */ static struct _xttymodes { char *name; size_t len; int set; - Char value; + int value; } ttymodelist[] = { TTYMODE("intr"), /* tchars.t_intrc ; VINTR */ #define XTTYMODE_intr 0 @@ -301,7 +301,8 @@ static XtResource application_resources[] = #endif #if OPT_PTY_HANDSHAKE Bres("waitForMap", "WaitForMap", wait_for_map, False), - Bres("ptyHandshake", "PtyHandshake", ptyHandshake, DEF_PTY_HANDSHAKE), + Bres("ptyHandshake", "PtyHandshake", ptyHandshake, True), + Bres("ptySttySize", "PtySttySize", ptySttySize, DEF_PTY_STTY_SIZE), #endif #if OPT_SAME_NAME Bres("sameName", "SameName", sameName, True), @@ -465,6 +466,8 @@ static XrmOptionDescRec optionDescList[] = { {"-lcc", "*localeFilter",XrmoptionSepArg, (caddr_t) NULL}, {"-en", "*locale", XrmoptionSepArg, (caddr_t) NULL}, #endif +{"-uc", "*cursorUnderLine", XrmoptionNoArg, (caddr_t) "on"}, +{"+uc", "*cursorUnderLine", XrmoptionNoArg, (caddr_t) "off"}, {"-ulc", "*colorULMode", XrmoptionNoArg, (caddr_t) "off"}, {"+ulc", "*colorULMode", XrmoptionNoArg, (caddr_t) "on"}, {"-ulit", "*italicULMode", XrmoptionNoArg, (caddr_t) "off"}, @@ -635,6 +638,7 @@ static OptionHelp xtermOptions[] = { { "-/+lc", "turn on/off locale mode using luit" }, { "-lcc path", "filename of locale converter (" DEFLOCALEFILTER ")" }, #endif +{ "-/+uc", "turn on/off underline cursor" }, { "-/+ulc", "turn off/on display of underline as color" }, { "-/+ut", "turn on/off utmp inhibit (not supported)" }, { "-/+ulit", "turn off/on display of underline as italics" }, @@ -668,21 +672,32 @@ static OptionHelp xtermOptions[] = { { NULL, NULL }}; /* *INDENT-ON* */ -/*debug FILE *confd;*/ -/*static void opencons() -{ - if ((confd=fopen("/dev/console$","w")) < 0) { - fputs("!!! Cannot open console device.\n", - stderr); - exit(1); - } -} +#ifdef DBG_CONSOLE +FILE *confd; -static void closecons(void) +static void +closecons(void) { + if (confs != 0) { fclose(confd); + confd = 0; + } } -*/ +static void +opencons(void) +{ + closecons(); + if ((confd = fopen("/dev/console$", "w")) < 0) { + fputs("!!! Cannot open console device.\n", + stderr); + exit(1); + } +} +#else +#define opencons() /* nothing */ +#define closecons() /* nothing */ +#endif + static char *message[] = { "Fonts should be fixed width and, if both normal and bold are specified, should", @@ -957,7 +972,7 @@ main(int argc, char **argv ENVP_ARG) setlocale(LC_ALL, NULL); #endif -/*debug opencons();*/ + opencons(); ttydev = TypeMallocN(char, PTMS_BUFSZ); ptydev = TypeMallocN(char, PTMS_BUFSZ); @@ -1023,7 +1038,7 @@ main(int argc, char **argv ENVP_ARG) fprintf(stderr, "%s: bad tty modes \"%s\"\n", ProgramName, resource.tty_modes); } else if (n > 0) { - override_tty_modes = 1; + override_tty_modes = True; } } #if OPT_ZICONBEEP @@ -1701,8 +1716,7 @@ spawnXTerm(XtermWidget xw) case 0: /* child */ whoami = THE_CHILD; -/*debug fclose(confd); -opencons();*/ + opencons(); /* we don't need the socket, or the pty master anymore */ close(ConnectionNumber(screen->display)); close(screen->respond); @@ -1758,7 +1772,7 @@ opencons();*/ int on = 1; if (ioctl(ttyfd, TIOCCONS, (char *) &on) == -1) fprintf(stderr, "%s: cannot open console: %s\n", - xterm_name, strerror(errno)); + ProgramName, strerror(errno)); } } @@ -1847,9 +1861,9 @@ opencons();*/ execvp(*command_to_exec_with_luit, command_to_exec_with_luit); /* print error message on screen */ fprintf(stderr, "%s: Can't execvp %s: %s\n", - xterm_name, *command_to_exec_with_luit, strerror(errno)); + ProgramName, *command_to_exec_with_luit, strerror(errno)); fprintf(stderr, "%s: cannot support your locale.\n", - xterm_name); + ProgramName); } #endif if (command_to_exec) { @@ -1860,7 +1874,7 @@ opencons();*/ /* print error message on screen */ fprintf(stderr, "%s: Can't execvp %s\n", - xterm_name, *command_to_exec); + ProgramName, *command_to_exec); } /* use a layered mechanism to find a shell */ @@ -1891,13 +1905,13 @@ opencons();*/ /* print error message on screen */ fprintf(stderr, "%s: Can't execvp %s\n", - xterm_name, *command_to_exec); + ProgramName, *command_to_exec); } else { execlpe(ptr, shname, 0, gblenvp); /* Exec failed. */ fprintf(stderr, "%s: Could not exec %s!\n", - xterm_name, ptr); + ProgramName, ptr); } sleep(5); diff --git a/app/xterm/ptyx.h b/app/xterm/ptyx.h index 717584d54..cf9276092 100644 --- a/app/xterm/ptyx.h +++ b/app/xterm/ptyx.h @@ -1,4 +1,4 @@ -/* $XTermId: ptyx.h,v 1.517 2008/07/27 19:38:00 tom Exp $ */ +/* $XTermId: ptyx.h,v 1.518 2008/09/14 15:16:20 Paul.Lampert Exp $ */ /* * Copyright 1999-2007,2008 by Thomas E. Dickey @@ -1463,6 +1463,7 @@ typedef struct { int cursor_state; /* ON, OFF, or BLINKED_OFF */ int cursor_busy; /* do not redraw... */ + Boolean cursor_underline; /* true if cursor is in underline mode */ #if OPT_BLINK_CURS Boolean cursor_blink; /* cursor blink enable */ Boolean cursor_blink_res; /* initial cursor blink value */ diff --git a/app/xterm/version.h b/app/xterm/version.h index 3056d53a9..66f3268a8 100644 --- a/app/xterm/version.h +++ b/app/xterm/version.h @@ -1,4 +1,4 @@ -/* $XTermId: version.h,v 1.292 2008/05/26 19:18:04 tom Exp $ */ +/* $XTermId: version.h,v 1.293 2008/09/14 13:45:26 tom Exp $ */ /* * These definitions are used to build the string that's printed in response to @@ -6,7 +6,7 @@ * version of X to which this version of xterm has been built. The number in * parentheses is my patch number (Thomas E. Dickey). */ -#define XTERM_PATCH 236 +#define XTERM_PATCH 237 #ifndef __vendorversion__ #define __vendorversion__ "XTerm/OpenBSD" diff --git a/app/xterm/xterm.h b/app/xterm/xterm.h index 478cec666..d5e81b9ad 100644 --- a/app/xterm/xterm.h +++ b/app/xterm/xterm.h @@ -1,4 +1,4 @@ -/* $XTermId: xterm.h,v 1.502 2008/05/26 19:23:05 tom Exp $ */ +/* $XTermId: xterm.h,v 1.503 2008/09/14 15:18:39 Paul.Lampert Exp $ */ /************************************************************ @@ -377,6 +377,7 @@ extern char **environ; #define XtNcursorColor "cursorColor" #define XtNcursorOffTime "cursorOffTime" #define XtNcursorOnTime "cursorOnTime" +#define XtNcursorUnderline "cursorUnderLine" #define XtNcutNewline "cutNewline" #define XtNcutToBeginningOfLine "cutToBeginningOfLine" #define XtNdecTerminalID "decTerminalID" @@ -526,6 +527,7 @@ extern char **environ; #define XtCCursorBlink "CursorBlink" #define XtCCursorOffTime "CursorOffTime" #define XtCCursorOnTime "CursorOnTime" +#define XtCCursorUnderline "CursorUnderLine" #define XtCCutNewline "CutNewline" #define XtCCutToBeginningOfLine "CutToBeginningOfLine" #define XtCDecTerminalID "DecTerminalID" diff --git a/app/xterm/xterm.log.html b/app/xterm/xterm.log.html index 9cb1fc03d..7502e8691 100644 --- a/app/xterm/xterm.log.html +++ b/app/xterm/xterm.log.html @@ -20,7 +20,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ***************************************************************************** - $XTermId: xterm.log.html,v 1.685 2008/07/27 23:10:10 tom Exp $ + $XTermId: xterm.log.html,v 1.690 2008/09/14 23:43:15 tom Exp $ --> @@ -45,6 +45,7 @@ Most of these are summarized in the XFree86 CHANGELOG is the latest version of this file. +

Patch #237 - 2008/09/14

+

Patch #236 - 2008/07/27