render: flush glyph sequence after erase previous cursor

If not, we may have scrolled when we later flush the glyph sequence,
causing the glyph to be rendered in wrong location.
This commit is contained in:
Daniel Eklöf 2019-07-26 18:50:41 +02:00
parent 3e06dca12d
commit 269e04fa1b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -56,6 +56,9 @@ color_dim(struct rgb *rgb)
static void
gseq_flush(struct terminal *term, struct buffer *buf)
{
if (gseq.count == 0)
return;
struct rgb fg = color_hex_to_rgb(gseq.foreground);
if (gseq.attrs.dim)
@ -392,6 +395,9 @@ grid_render(struct terminal *term)
term->render.last_cursor.in_view.col,
term->render.last_cursor.in_view.row, false);
/* Must flush now since scroll damage will shift the entire pixmap */
gseq_flush(term, buf);
wl_surface_damage_buffer(
term->wl.surface,
term->render.last_cursor.in_view.col * term->cell_width,
@ -540,15 +546,13 @@ grid_render(struct terminal *term)
term->cell_width, term->cell_height);
}
gseq_flush(term, buf);
if (all_clean) {
buf->busy = false;
gseq_flush(term, buf);
return;
}
if (gseq.count > 0)
gseq_flush(term, buf);
if (term->flash.active) {
cairo_set_source_rgba(buf->cairo, 1.0, 1.0, 0.0, 0.5);
cairo_set_operator(buf->cairo, CAIRO_OPERATOR_OVER);