From 00b46455a065d33cb01dc6345637b38c3309596d Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 2 Nov 2019 00:33:37 +0100 Subject: shm: associate a 'cookie' with each buffer When re-using a buffer from cache, only re-use ones with a matching cookie. This prevents contention between multiple terminal windows. --- shm.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'shm.h') diff --git a/shm.h b/shm.h index 312d45a9..555c5d51 100644 --- a/shm.h +++ b/shm.h @@ -7,6 +7,8 @@ #include struct buffer { + unsigned long cookie; + int width; int height; int stride; @@ -19,5 +21,6 @@ struct buffer { pixman_image_t *pix; }; -struct buffer *shm_get_buffer(struct wl_shm *shm, int width, int height); +struct buffer *shm_get_buffer( + struct wl_shm *shm, int width, int height, unsigned long cookie); void shm_fini(void); -- cgit v1.3