aboutsummaryrefslogtreecommitdiff
path: root/shm.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-01 23:33:37 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-01 23:33:37 +0000
commit00b46455a065d33cb01dc6345637b38c3309596d (patch)
tree49c74942782cb88fa7f68d19f564ae2dcde2116d /shm.h
parentshm: get_buffer(): remove 'copies' argument; it's not used (diff)
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.
Diffstat (limited to 'shm.h')
-rw-r--r--shm.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/shm.h b/shm.h
index 312d45a9..555c5d51 100644
--- a/shm.h
+++ b/shm.h
@@ -7,6 +7,8 @@
#include <wayland-client.h>
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);