url-mode: damage current view before entering URL mode

Clear scroll damage and damage the entire viewport before entering URL
mode. This will cause us to do a full screen redraw both when entering
URL mode, and later when exiting it.

Clearing the scroll damage is necessary to ensure we don’t apply it
twice (once for the snapshot:ed grid, and later again for the real
grid), as that would result in an incorrect pixmap.

But, since we’ve cleared the scroll damage, we need to damage the
entire view to ensure we redraw the contents correctly.
This commit is contained in:
Daniel Eklöf 2021-02-24 21:39:29 +01:00
parent 3c123425fb
commit ae0f20a536
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -648,6 +648,14 @@ urls_render(struct terminal *term)
}
term->render.last_cursor.row = NULL;
/* Clear scroll damage, to ensure we dont apply it twice (once on
* the snapshot:ed grid, and then later again on the real grid) */
tll_free(term->grid->scroll_damage);
/* Damage the entire view, to ensure a full screen redraw, both
* now, when entering URL mode, and later, when exiting it. */
term_damage_view(term);
/* Snapshot the current grid */
term->url_grid_snapshot = grid_snapshot(term->grid);