From 1a720edbad272eb632fbf7e603b3df9e7a872661 Mon Sep 17 00:00:00 2001 From: Bernd Busse Date: Tue, 1 Sep 2020 00:07:28 +0200 Subject: [PATCH] win: clear SHADOW_STALE in destroy_win_start Clear both STALE flags (`IMAGES_STALE = PIXMAP_STALE | SHADOW_STALE`) when destroying windows (see f493447b33daf009cc0a15fa52f52115bbc91cc9). 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 --- src/win.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/win.c b/src/win.c index 64f9318..02db0dd 100644 --- a/src/win.c +++ b/src/win.c @@ -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;