Skip to content

Commit 1ff8f66

Browse files
committed
animation: fix interrupting animation makes it stuck for one frame
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
1 parent 3eb5da6 commit 1ff8f66

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wm/win.c

+4
Original file line numberDiff line numberDiff line change
@@ -1933,6 +1933,10 @@ bool win_process_animation_and_state_change(struct session *ps, struct win *w, d
19331933

19341934
auto new_animation = script_instance_new(wopts.animations[trigger].script);
19351935
if (w->running_animation_instance) {
1936+
// Interrupt the old animation and start the new animation from where the
1937+
// old has left off. Note we still need to advance the old animation for
1938+
// the last interval.
1939+
win_advance_animation(w, delta_t, &win_ctx);
19361940
if (geometry_changed) {
19371941
// If the window has moved, we need to adjust scripts
19381942
// outputs so that the window will stay in the same position and

0 commit comments

Comments
 (0)