Skip to content

fix(addon-image): disable desynchronized resize canvas#5766

Open
SergioChan wants to merge 2 commits intoxtermjs:masterfrom
SergioChan:fix-image-renderer-desync-5691
Open

fix(addon-image): disable desynchronized resize canvas#5766
SergioChan wants to merge 2 commits intoxtermjs:masterfrom
SergioChan:fix-image-renderer-desync-5691

Conversation

@SergioChan
Copy link
Copy Markdown
Contributor

Summary

  • Image addon currently creates layer canvases with { desynchronized: true }.
  • During resize this can show blank-frame jitter on some platforms because repaint may miss the resize frame.
  • Switch layer canvas creation to { desynchronized: false } so resize and repaint stay synchronized.

Fixes #5691.

Validation

  • npm run lint -- addons/addon-image/src/ImageRenderer.ts

Disable desynchronized 2D canvas mode for image layers so resize paint stays synchronized and avoids blank-frame jitter on some platforms.

Signed-off-by: sergiochan <[email protected]>
@Tyriar
Copy link
Copy Markdown
Member

Tyriar commented Mar 12, 2026

Need to test this on Windows before and after to verify it's fixed.

@SergioChan
Copy link
Copy Markdown
Contributor Author

Thanks — I ran a Windows before/after check as requested.

Environment:

  • Windows 10 (22H2)
  • Chrome (stable)
  • xterm.js demo page (image addon, snake sample)

What I tested:

  1. Before: local baseline with desynchronized: true in ImageRenderer.ts
  2. After: this PR version with desynchronized: false
  3. Repeated rapid resize loops between narrow/wide viewport sizes + manual drag-resizing.

Result:

  • I could not reproduce visible jitter/blank-frame behavior in my Windows environment in either baseline or patched variant.
  • So from this machine I can’t provide a “before jitters / after fixed” confirmation yet.

If you have a specific repro setup (GPU/browser flags/display scale/steps) where you can reproduce reliably, I can rerun exactly that path and report back with targeted results.

@Tyriar
Copy link
Copy Markdown
Member

Tyriar commented Mar 12, 2026

Let's put this on hold until I can test on the machine I know I saw it on then.

@Tyriar Tyriar added this to the 7.0.0 milestone Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Images jitter when resizing the demo window

2 participants