Skip to content

Commit

Permalink
fixes animations on destroying/unmapping windows
Browse files Browse the repository at this point in the history
  • Loading branch information
FT-Labs committed Feb 9, 2024
1 parent 77c4eba commit 39534b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/picom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,16 +1051,18 @@ 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);
pixman_region32_fini(&w->bounding_shape);
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) {
Expand Down
10 changes: 7 additions & 3 deletions src/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 39534b9

Please sign in to comment.