wayland: purge CSD pixmaps when destroying the CSDs

CSDs aren’t typically toggled on and off. Thus, when disabled,
immediately purge their corresponding pixmap buffers, to free up some
memory, and release file descriptors.
This commit is contained in:
Daniel Eklöf 2021-07-11 09:59:25 +02:00
parent 0a6e7e6167
commit b5950d9b27
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -51,8 +51,13 @@ csd_instantiate(struct wl_window *win)
static void
csd_destroy(struct wl_window *win)
{
for (size_t i = 0; i < ALEN(win->csd.surface); i++)
struct terminal *term = win->term;
struct wl_shm *shm = term->wl->shm;
for (size_t i = 0; i < ALEN(win->csd.surface); i++) {
wayl_win_subsurface_destroy(&win->csd.surface[i]);
shm_purge(shm, shm_cookie_csd(term, i));
}
}
static void