1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-05-29 15:54:48 -05:00

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.

[originally from svn r4586]
This commit is contained in:
Jacob Nevins 2004-09-28 20:42:39 +00:00
parent aba082f324
commit 3a11379597

View File

@ -2022,7 +2022,7 @@ void do_cursor(Context ctx, int x, int y, char *text, int len,
struct gui_data *inst = dctx->inst; struct gui_data *inst = dctx->inst;
GdkGC *gc = dctx->gc; GdkGC *gc = dctx->gc;
int passive, widefactor; int active, passive, widefactor;
if (attr & TATTR_PASCURS) { if (attr & TATTR_PASCURS) {
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; passive = 0;
if ((attr & TATTR_ACTCURS) && inst->cfg.cursor_type != 0) { if ((attr & TATTR_ACTCURS) && inst->cfg.cursor_type != 0) {
attr &= ~TATTR_ACTCURS; attr &= ~TATTR_ACTCURS;
} active = 1;
} else
active = 0;
do_text_internal(ctx, x, y, text, len, attr, lattr); do_text_internal(ctx, x, y, text, len, attr, lattr);
if (attr & ATTR_WIDE) { if (attr & ATTR_WIDE) {
@ -2103,10 +2105,10 @@ void do_cursor(Context ctx, int x, int y, char *text, int len,
startx += dx; startx += dx;
starty += dy; starty += dy;
} }
} else { } else if (active) {
gdk_draw_line(inst->pixmap, gc, startx, starty, gdk_draw_line(inst->pixmap, gc, startx, starty,
startx + (length-1) * dx, starty + (length-1) * dy); startx + (length-1) * dx, starty + (length-1) * dy);
} } /* else no cursor (e.g., blinked off) */
} }
gdk_draw_pixmap(inst->area->window, gc, inst->pixmap, gdk_draw_pixmap(inst->area->window, gc, inst->pixmap,