shm: discard shm buffers with mis-matching alpha-setting

This commit is contained in:
Daniel Eklöf 2024-06-24 17:55:07 +02:00
parent c45231ef89
commit 795e39de1a
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 5 additions and 1 deletions

View file

@ -97,6 +97,8 @@
([#1734][1734]).
* XKB compose state being reset when foot receives a new keymap
([#1744][1744]).
* Regression: alpha changes through OSC-11 sequences not taking effect
until window is resized.
[1694]: https://codeberg.org/dnkl/foot/issues/1694
[1717]: https://codeberg.org/dnkl/foot/issues/1717

4
shm.c
View file

@ -564,7 +564,9 @@ shm_get_buffer(struct buffer_chain *chain, int width, int height, bool with_alph
tll_foreach(chain->bufs, it) {
struct buffer_private *buf = it->item;
if (buf->public.width != width || buf->public.height != height) {
if (buf->public.width != width || buf->public.height != height ||
with_alpha != buf->with_alpha)
{
LOG_DBG("purging mismatching buffer %p", (void *)buf);
if (buffer_unref_no_remove_from_chain(buf))
tll_remove(chain->bufs, it);