mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
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.
This commit is contained in:
parent
8df82938b0
commit
00b46455a0
3 changed files with 22 additions and 9 deletions
5
shm.h
5
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue