From 4e6dddc76e7db7f6c98b3dcb2efce192bae4e17d Mon Sep 17 00:00:00 2001 From: Monsterovich Date: Fri, 30 Jun 2023 00:28:45 +0200 Subject: [PATCH] win: don't re-bind mask image when there is already one Co-authored-by: Yuxuan Shui --- src/win.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/win.c b/src/win.c index a97733db..1aa10fd2 100644 --- a/src/win.c +++ b/src/win.c @@ -368,7 +368,10 @@ bool win_bind_shadow(struct backend_base *b, struct managed_win *w, struct color b->ops->shadow_from_mask == NULL) { w->shadow_image = b->ops->render_shadow(b, w->widthb, w->heightb, sctx, c); } else { - win_bind_mask(b, w); + if (!w->mask_image) { + // It's possible we already allocated a mask because of background blur + win_bind_mask(b, w); + } w->shadow_image = b->ops->shadow_from_mask(b, w->mask_image, sctx, c); } if (!w->shadow_image) {