From 0a6e7e6167e04e1ee38cfaba4d38c2776cf474b4 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 11 Jul 2021 09:54:04 +0200 Subject: url-mode: purge SHM pixmaps when destroying URLs Unlike other surface types, the SHM cookie depends on the address of each URL instance. This means if we enable, disable, and then enable URL mode again (thus showing exactly the same URLs as the first time), the URLs will have new addresses, and thus the old SHM pixmaps will not get purged automatically. So, manually purge them when destroying the URLs. --- url-mode.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'url-mode.c') diff --git a/url-mode.c b/url-mode.c index 5f56a2f6..8ac5631e 100644 --- a/url-mode.c +++ b/url-mode.c @@ -14,6 +14,7 @@ #include "grid.h" #include "render.h" #include "selection.h" +#include "shm.h" #include "spawn.h" #include "terminal.h" #include "uri.h" @@ -728,7 +729,9 @@ urls_reset(struct terminal *term) if (term->window != NULL) { tll_foreach(term->window->urls, it) { + const struct url *url = it->item.url; wayl_win_subsurface_destroy(&it->item.surf); + shm_purge(term->wl->shm, shm_cookie_url(url)); tll_remove(term->window->urls, it); } } -- cgit v1.3