win: clear SHADOW_STALE in destroy_win_start

Clear both STALE flags (`IMAGES_STALE = PIXMAP_STALE | SHADOW_STALE`)
when destroying windows (see f493447b33).

Clearing `SHADOW_STALE` as well should eliminate the recreation of a shadow
image for a window currently being destroyed which will cause the
rendering to fail because we can't properly update the flags anymore.

Should fix: #394
This commit is contained in:
Bernd Busse 2020-09-01 00:07:28 +02:00
parent f53fbdccca
commit 1a720edbad
No known key found for this signature in database
GPG Key ID: 6DD2A3C48E63A5AB
1 changed files with 7 additions and 3 deletions

View File

@ -2030,10 +2030,14 @@ bool destroy_win_start(session_t *ps, struct win *w) {
}
if (w->managed) {
// Clear PIXMAP_STALE flag, since the window is destroyed there is no
// pixmap available so STALE doesn't make sense.
// Clear IMAGES_STALE flags since the window is destroyed: Clear
// PIXMAP_STALE as there is no pixmap available anymore, so STALE doesn't
// make sense.
// XXX Clear SHADOW_STALE as setting/clearing flags on a destroyed window
// doesn't work leading to an inconsistent state where the shadow is
// refreshed but the flags are stuck in STALE.
// Do this before changing the window state to destroying
win_clear_flags(mw, WIN_FLAGS_PIXMAP_STALE);
win_clear_flags(mw, WIN_FLAGS_IMAGES_STALE);
// Update state flags of a managed window
mw->state = WSTATE_DESTROYING;