Skip to content

Commit

Permalink
Make sure an animatin ID is not used by following fixed frame.
Browse files Browse the repository at this point in the history
We create an animation with a start ID, using that and (ID+1)
for following animation. Make sure, (ID+1) is not used for next image.
  • Loading branch information
hzeller committed Jan 2, 2025
1 parent 4546ea1 commit 2f6eb12
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/kitty-canvas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ void KittyGraphicsCanvas::Send(int x, int dy, const Framebuffer &fb_orig,
case SeqType::StartOfAnimation:
// Sending a bunch of images with different IDs overwhelms some
// terminals. So, for animations, just use two IDs back/forth.
id = CreateId();
id = CreateId();
CreateId(); // Also, reserve the next ID that we use in the flip-buffer
animation_id = id;
flip_buffer = 0;
break;
case SeqType::AnimationFrame:
++flip_buffer;
Expand Down

0 comments on commit 2f6eb12

Please sign in to comment.