win: fix assertion failures in old backends

These asserts only hold when using the experimental backends.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2020-03-17 17:31:19 +00:00
parent 36e9ccd5be
commit d9b407c6b4
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 4 additions and 2 deletions

View File

@ -731,13 +731,15 @@ static void win_set_shadow(session_t *ps, struct managed_win *w, bool shadow_new
// asserting the existence of the shadow image.
if (w->shadow) {
// Mark the new extents as damaged if the shadow is added
assert(!w->shadow_image || (w->flags & WIN_FLAGS_SHADOW_STALE));
assert(!w->shadow_image || (w->flags & WIN_FLAGS_SHADOW_STALE) ||
!ps->o.experimental_backends);
pixman_region32_clear(&extents);
win_extents(w, &extents);
add_damage_from_win(ps, w);
} else {
// Mark the old extents as damaged if the shadow is removed
assert(w->shadow_image || (w->flags & WIN_FLAGS_SHADOW_STALE));
assert(w->shadow_image || (w->flags & WIN_FLAGS_SHADOW_STALE) ||
!ps->o.experimental_backends);
add_damage(ps, &extents);
}