render: render non-block cursors after rendering the glyph + decorations

This fixes an issue where an 'underline' cursor wasn't visible on
underlined text - the cursor was rendered first, and then shadowed by
the text underline.
This commit is contained in:
Daniel Eklöf 2020-03-17 11:47:47 +01:00
parent 233a909160
commit 93207bc482
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 9 additions and 4 deletions

View file

@ -29,6 +29,7 @@
* Sixel images moved or deleted on window resize.
* Cursor sometimes incorrectly restored on exit from alternate screen.
* 'Underline' cursor being invisible on underlined text.
### Security

View file

@ -432,14 +432,14 @@ render_cell(struct terminal *term, pixman_image_t *pix,
PIXMAN_OP_SRC, pix, &bg, 1,
&(pixman_rectangle16_t){x, y, cell_cols * width, height});
if (has_cursor)
draw_cursor(term, cell, font, pix, &fg, &bg, x, y, cell_cols);
if (cell->attrs.blink)
term_arm_blink_timer(term);
if (has_cursor && term->cursor_style == CURSOR_BLOCK)
draw_cursor(term, cell, font, pix, &fg, &bg, x, y, cell_cols);
if (cell->wc == 0 || cell->attrs.conceal)
return cell_cols;
goto draw_cursor;
if (glyph != NULL) {
if (unlikely(pixman_image_get_format(glyph->pix) == PIXMAN_a8r8g8b8)) {
@ -472,6 +472,10 @@ render_cell(struct terminal *term, pixman_image_t *pix,
&fg, x, y, cell_cols);
}
draw_cursor:
if (has_cursor && term->cursor_style != CURSOR_BLOCK)
draw_cursor(term, cell, font, pix, &fg, &bg, x, y, cell_cols);
return cell_cols;
}