TRACE(("%s @%d, calling drawXtermText\n", __FILE__, __LINE__))
TRACE(("%s @%d, ShowCursor calling drawXtermText cur(%d,%d)\n", __FILE__, __LINE__, screen->cur_row, screen->cur_col));
ShowCursor(void){	register TScreen *screen = &term->screen;	register int x, y, flags;	Char	c;	Char	fg_bg = 0;	GC	currentGC;	Boolean	in_selection;	Pixel fg_pix;	Pixel bg_pix;	Pixel tmp;#if OPT_HIGHLIGHT_COLOR	Pixel hi_pix = screen->highlightcolor;#endif	if (screen->cursor_state == BLINKED_OFF)		return;	if (eventMode != NORMAL) return;	if (screen->cur_row - screen->topline > screen->max_row)		return;	screen->cursor_row = screen->cur_row;	screen->cursor_col = screen->cur_col;	c     = SCRN_BUF_CHARS(screen, screen->cursor_row)[screen->cursor_col];	flags = SCRN_BUF_ATTRS(screen, screen->cursor_row)[screen->cursor_col];#ifndef NO_ACTIVE_ICON	if (IsIcon(screen)) {	    screen->cursor_state = ON;	    return;	}#endif /* NO_ACTIVE_ICON */	if (c == 0)		c = ' ';	/*	 * Compare the current cell to the last set of colors used for the	 * cursor and update the GC's if needed.	 */#if OPT_ISO_COLORS	if_OPT_ISO_COLORS(screen,{	    fg_bg = SCRN_BUF_COLOR(screen, screen->cursor_row)[screen->cursor_col];	})#endif	fg_pix = getXtermForeground(flags,extract_fg(fg_bg,flags));	bg_pix = getXtermBackground(flags,extract_bg(fg_bg));	if (screen->cur_row > screen->endHRow ||	    (screen->cur_row == screen->endHRow &&	     screen->cur_col >= screen->endHCol) ||	    screen->cur_row < screen->startHRow ||	    (screen->cur_row == screen->startHRow &&	     screen->cur_col < screen->startHCol))	    in_selection = False;	else	    in_selection = True;	/* This is like updatedXtermGC(), except that we have to worry about	 * whether the window has focus, since in that case we want just an	 * outline for the cursor.	 */	if(screen->select || screen->always_highlight) {		if (( (flags & INVERSE) && !in_selection) ||		    (!(flags & INVERSE) &&  in_selection)){		    /* text is reverse video */		    if (screen->cursorGC) {			currentGC = screen->cursorGC;		    } else {			if (flags & (BOLD|BLINK)) {				currentGC = NormalBoldGC(screen);			} else {				currentGC = NormalGC(screen);			}		    }#if OPT_HIGHLIGHT_COLOR		    if (hi_pix != screen->foreground		     && hi_pix != fg_pix		     && hi_pix != bg_pix		     && hi_pix != term->dft_foreground) {			bg_pix = fg_pix;			fg_pix = hi_pix;		    }#endif		    EXCHANGE(fg_pix, bg_pix, tmp)		} else { /* normal video */		    if (screen->reversecursorGC) {			currentGC = screen->reversecursorGC;		    } else {			if (flags & (BOLD|BLINK)) {				currentGC = ReverseBoldGC(screen);			} else {				currentGC = ReverseGC(screen);			}		    }		}		if (screen->cursorcolor == term->dft_foreground) {			XSetForeground(screen->display, currentGC, bg_pix);			XSetBackground(screen->display, currentGC, fg_pix);		}	} else { /* not selected */		if (( (flags & INVERSE) && !in_selection) ||		    (!(flags & INVERSE) &&  in_selection)) {		    /* text is reverse video */			currentGC = ReverseGC(screen);		} else { /* normal video */			currentGC = NormalGC(screen);		}		if (screen->cursorcolor == term->dft_foreground) {			XSetForeground(screen->display, currentGC, fg_pix);			XSetBackground(screen->display, currentGC, bg_pix);		}	}	TRACE(("%s @%d, calling drawXtermText\n", __FILE__, __LINE__))	drawXtermText(screen, flags, currentGC,		x = CurCursorX(screen, screen->cur_row, screen->cur_col),		y = CursorY(screen, screen->cur_row),		curXtermChrSet(screen->cur_row),		&c, 1);	if (!screen->select && !screen->always_highlight) {		screen->box->x = x;		screen->box->y = y;		XDrawLines (screen->display, TextWindow(screen),			    screen->cursoroutlineGC ? screen->cursoroutlineGC			    			    : currentGC,			    screen->box, NBOX, CoordModePrevious);	}	screen->cursor_state = ON;}