From a6db1e95b379d4a02c5ba6ec728d71c8a648095c Mon Sep 17 00:00:00 2001 From: jacob Date: Tue, 28 Sep 2004 20:42:39 +0000 Subject: [PATCH] Line (as opposed to block) cursors were being displayed when they shouldn't have been, including when they were blinked off. Fixes Debian bug #272877. git-svn-id: svn://svn.tartarus.org/sgt/putty@4586 cda61777-01e9-0310-a592-d414129be87e --- unix/pterm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/unix/pterm.c b/unix/pterm.c index fba33980..f25475a1 100644 --- a/unix/pterm.c +++ b/unix/pterm.c @@ -2022,7 +2022,7 @@ void do_cursor(Context ctx, int x, int y, char *text, int len, struct gui_data *inst = dctx->inst; GdkGC *gc = dctx->gc; - int passive, widefactor; + int active, passive, widefactor; if (attr & TATTR_PASCURS) { attr &= ~TATTR_PASCURS; @@ -2031,7 +2031,9 @@ void do_cursor(Context ctx, int x, int y, char *text, int len, passive = 0; if ((attr & TATTR_ACTCURS) && inst->cfg.cursor_type != 0) { attr &= ~TATTR_ACTCURS; - } + active = 1; + } else + active = 0; do_text_internal(ctx, x, y, text, len, attr, lattr); if (attr & ATTR_WIDE) { @@ -2103,10 +2105,10 @@ void do_cursor(Context ctx, int x, int y, char *text, int len, startx += dx; starty += dy; } - } else { + } else if (active) { gdk_draw_line(inst->pixmap, gc, startx, starty, startx + (length-1) * dx, starty + (length-1) * dy); - } + } /* else no cursor (e.g., blinked off) */ } gdk_draw_pixmap(inst->area->window, gc, inst->pixmap, -- 2.11.0