From e66a452a27f342cde8871330e0c851f8bc22bbd4 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Fri, 4 Dec 2020 02:58:02 +0000 Subject: [PATCH] win: skip fading out for window which aren't ever damaged Signed-off-by: Yuxuan Shui --- src/win.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/win.c b/src/win.c index 0a748df..bf8a502 100644 --- a/src/win.c +++ b/src/win.c @@ -2262,7 +2262,13 @@ void unmap_win_start(session_t *ps, struct managed_win *w) { } #endif - if (!ps->redirected) { + if (!ps->redirected || !w->ever_damaged) { + // If we are not redirected, we skip fading because we aren't rendering + // anything anyway. + // If the window isn't ever damaged, it won't be painted either (see + // paint_preprocess), so we can skip fading. This is different from + // mapping, because a mapped window could receive damage while it's fading + // in, but an unmapped window couldn't while it's fading out. CHECK(!win_skip_fading(ps, w)); } }