win: don't re-bind mask image when there is already one

Co-authored-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Monsterovich 2023-06-30 00:28:45 +02:00 committed by GitHub
parent d4f72828f7
commit 4e6dddc76e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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) {