Skip to content

desktop: fast redraws and resizes (GPU on, batched output, throttled resize) (0.2.4) - #5

Merged
ralyodio merged 2 commits into
mainfrom
fix/desktop-render-perf
Oct 6, 2026
Merged

ralyodio merged 2 commits into
mainfrom
fix/desktop-render-perf

Conversation

@ralyodio

@ralyodio ralyodio commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Anthony on KDE: "ui is a little glitchy, mainly the slow rendering on resizes, and screen redraws are really slow and visible … it needs to be fast".

Causes found

  1. GPU: xterm 6 has no canvas renderer; fast means WebGL. Electron on Linux often blocklists the GPU (and under Wayland runs through XWayland), so panes silently fell back to the DOM renderer.
  2. Output: every PTY read was its own IPC message and its own renderer task. A full-screen redraw arrives as dozens of reads, so you watched it being drawn piece by piece.
  3. Resize: a refit on every animation frame reflowed 10k lines of scrollback each time, and resized the PTY on every frame. Over hqsh that makes the remote program redraw dozens of times a second.

Fixes

  • ignore-gpu-blocklist, enable-gpu-rasterization, enable-zero-copy, and native Wayland (ozone-platform-hint=auto, WaylandWindowDecorations) when on Wayland. "gpu": false in ~/.config/hqterm/desktop.json opts out. GPU status is written to ~/.config/hqterm/desktop.log at startup.
  • PTY output is coalesced per pane: one IPC message every 4 ms, or immediately at 256 KiB.
  • Refit at most every 50 ms during a drag, plus a trailing fit. The PTY is resized only after 80 ms of quiet.
  • A pane that can't get WebGL prints a one-line notice. A lost GPU context retries WebGL after 1 s instead of staying on the DOM renderer.

Version 0.2.4. A companion hqtui change follows: it will recognise TERM_PROGRAM=hqterm so hqtui apps (qc) send synchronized frames, which xterm 6 supports.

🤖 Generated with Claude Code

- GPU on: ignore Chromium's Linux GPU blocklist, GPU rasterization,
  zero-copy, native Wayland. Without it every pane fell back to xterm's DOM
  renderer, where redraws are visibly slow. desktop.json "gpu": false opts out;
  GPU status goes to ~/.config/hqterm/desktop.log.
- Coalesce PTY output into one IPC message per pane every 4 ms.
- Resize: refit at most every 50 ms while dragging (plus a trailing fit)
  instead of reflowing the scrollback every frame, and resize the PTY only
  after 80 ms of quiet, so remote programs (hqsh) are not flooded with redraws.
- A pane without WebGL says so once; a lost GPU context retries WebGL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e the compositor without a GPU)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 0f38970 into main Oct 6, 2026
4 checks passed
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.

1 participant