From ae0f20a53603c3e3657cbab5c548575d4d1147bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 24 Feb 2021 21:39:29 +0100 Subject: [PATCH] url-mode: damage current view before entering URL mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- url-mode.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/url-mode.c b/url-mode.c index 54edc524..791b4ce0 100644 --- a/url-mode.c +++ b/url-mode.c @@ -648,6 +648,14 @@ urls_render(struct terminal *term) } term->render.last_cursor.row = NULL; + /* Clear scroll damage, to ensure we don’t 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);