diff --git a/src/picom.c b/src/picom.c index c7eef127a8..5a93e9af1d 100644 --- a/src/picom.c +++ b/src/picom.c @@ -1051,7 +1051,7 @@ paint_preprocess(session_t *ps, bool *fade_running, bool *animation_running) { } // Submit window size change - if (size_changed && w->state != WSTATE_UNMAPPED && w->state != WSTATE_DESTROYING && w->state != WSTATE_UNMAPPING) { + if (size_changed) { win_on_win_size_change(ps, w); pixman_region32_clear(&w->bounding_shape); @@ -1059,8 +1059,10 @@ paint_preprocess(session_t *ps, bool *fade_running, bool *animation_running) { pixman_region32_init_rect(&w->bounding_shape, 0, 0, (uint)w->widthb, (uint)w->heightb); - win_clear_flags(w, WIN_FLAGS_PIXMAP_STALE); - win_process_image_flags(ps, w); + if (w->state != WSTATE_UNMAPPED && w->state != WSTATE_DESTROYING && w->state != WSTATE_UNMAPPING) { + win_clear_flags(w, WIN_FLAGS_PIXMAP_STALE); + win_process_image_flags(ps, w); + } } // Mark new window region with damage if (was_painted && geometry_changed) { diff --git a/src/win.c b/src/win.c index 17e7628710..97e00defce 100644 --- a/src/win.c +++ b/src/win.c @@ -485,7 +485,7 @@ static void init_animation(session_t *ps, struct managed_win *w) { static double *anim_x, *anim_y, *anim_w, *anim_h; enum open_window_animation animation; - + animation = ps->o.animation_for_open_window; if (w->window_type != WINTYPE_TOOLTIP && @@ -1538,8 +1538,12 @@ void win_on_win_size_change(session_t *ps, struct managed_win *w) { w->state != WSTATE_UNMAPPING); // Invalidate the shadow we built - win_set_flags(w, WIN_FLAGS_IMAGES_STALE); - win_release_mask(ps->backend_data, w); + // Do not set flags if window is unmapping and animation is running + if (w->state != WSTATE_UNMAPPED && w->state != WSTATE_DESTROYING && + w->state != WSTATE_UNMAPPING) { + win_set_flags(w, WIN_FLAGS_IMAGES_STALE); + win_release_mask(ps->backend_data, w); + } ps->pending_updates = true; free_paint(ps, &w->shadow_paint); }