1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-10-27 05:24:17 -04:00

Merge pull request #1211 from absolutelynothelix/temp

fix assertion failure if win_bind_shadow fails
This commit is contained in:
Yuxuan Shui 2024-02-29 19:26:45 +00:00 committed by GitHub
commit cc8e0a9848
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -332,16 +332,18 @@ bool paint_all_new(session_t *ps, struct managed_win *const t) {
}
}
// Draw shadow on target
if (w->shadow) {
if (w->shadow_image == NULL) {
// The win_bind_shadow function must be called before checking if a window
// has shadow enabled because it disables shadow for a window on failure.
if (w->shadow && !w->shadow_image) {
struct color shadow_color = {.red = ps->o.shadow_red,
.green = ps->o.shadow_green,
.blue = ps->o.shadow_blue,
.alpha = ps->o.shadow_opacity};
win_bind_shadow(ps->backend_data, w, shadow_color,
ps->shadow_context);
win_bind_shadow(ps->backend_data, w, shadow_color, ps->shadow_context);
}
// Draw shadow on target
if (w->shadow) {
// Clip region for the shadow
// reg_shadow \in reg_paint
auto reg_shadow = win_extents_by_val(w);