vnc: stop disabling XDAMAGE

-noxdamage was set in 106e5bd, the commit that introduced the mirror. That message explains every
other flag it chose — -scale, -shared, -forever, -localhost — and says nothing about this one, and
no doc or TODO mentions it either. It looks defensive rather than diagnosed.

It is not free. Without the DAMAGE extension x11vnc is never told which rectangles changed, so it
polls the entire framebuffer over and over to discover it. Cost then scales with screen AREA,
continuously, instead of with what actually moved. On a 4K mirror that dominates: it is why the
remote desktop here felt slow next to a machine with half the hardware and a sixth of the pixels.

xdpyinfo on this server reports DAMAGE, MIT-SHM and XFIXES, so the optimisation is available and
was simply switched off.

Kept as a comment rather than deleted silently: if stale patches ever appear (some drivers do
under-report damage) putting it back is the fix, and the next person should know that is the trade
rather than rediscovering it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-01 20:30:13 +00:00
co-authored by Claude Opus 5
parent c14cce6376
commit 2ddefa000c
+9 -1
View File
@@ -231,7 +231,15 @@ export async function startSession(params: VncStartParams): Promise<{ port: numb
'-shared', '-shared',
...clip, ...clip,
...scale, ...scale,
'-noxdamage', // No -noxdamage. It was set when this was written, with no recorded reason, and it is expensive:
// without the DAMAGE extension x11vnc cannot be told which rectangles changed, so it polls the
// WHOLE framebuffer continuously to find out. That makes cost scale with screen area rather than
// with what actually moved — on a 4K mirror it is the single biggest source of latency, and it is
// why a smaller machine felt instant by comparison. This X server reports DAMAGE, MIT-SHM and
// XFIXES, so the optimisation is genuinely available.
//
// If stale patches ever appear on screen (some drivers under-report damage), putting -noxdamage
// back is the fix — at the cost of the polling above.
'-quiet', '-quiet',
], ],
stdout: 'ignore', stdout: 'ignore',