vnc: back to mirroring the physical screen, at 1920x1080
Reverts the Xvnc virtual-desktop work (83bf746,f22c667). The separate desktop was the right answer to "4K on the TV and 1080p remote", but it brought a chain of its own problems — a dock left stranded below the bottom of the screen after every resize, because xfce4-panel does not follow a RandR change reliably — and the owner would rather have one session that works than two that need supervision. So: one GNOME session, mirrored, with the TV set to 1920x1080. That is under SCALE_ABOVE_WIDTH, so x11vnc serves it 1:1 with no scaling, and both ends see the same 1920x1080 desktop. resizeSession is now off on the client — a mirror reflects a physical screen and cannot be resized. scaleViewport stays ON and is load-bearing: noVNC maps a click as (clientX - canvasRect.left) / display._scale, and autoscale() is the only code that sets the canvas's displayed size and _scale in the same call. Disabling it pins _scale at 1 while the canvas is displayed at some other size, which doubled every pointer coordinate. That was my change and my bug. Kept from the Xvnc detour, because all of it applies to the mirror too: the display is discovered by socket ownership rather than assuming :0 (GDM gives :0 to its greeter), -noxdamage is gone, the clip to the primary output stays, noVNC loads as one bundle, and showDotCursor covers the invisible pointer. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -140,17 +140,12 @@ export const DesktopView = ({ className, style }: DesktopViewProps) => {
|
||||
credentials: { password },
|
||||
});
|
||||
|
||||
// BOTH. They are not alternatives — scaling is the fallback that covers the gap between resize
|
||||
// events, and more importantly it is what keeps the coordinate maths self-consistent.
|
||||
//
|
||||
// noVNC maps a click as (clientX - canvasRect.left) / display._scale. Only scaleViewport's
|
||||
// autoscale() sets the canvas's displayed size and _scale TOGETHER, so the two cannot disagree.
|
||||
// Turning it off pins _scale at 1 while the canvas keeps being displayed at some other size, and
|
||||
// nothing reconciles them: measured here, pointing a quarter of the way across the desktop landed
|
||||
// at 51%, and pointing at the middle saturated at the right-hand edge. A clean factor of two.
|
||||
// Clicks near the right and bottom edges still appeared to work, because doubling an already-large
|
||||
// coordinate clamps back onto the edge it was aimed at.
|
||||
rfb.resizeSession = true;
|
||||
// The mirror cannot resize — it reflects the physical screen — so resizeSession is off.
|
||||
// scaleViewport STAYS ON, and it is load-bearing: noVNC maps a click as
|
||||
// (clientX - canvasRect.left) / display._scale, and autoscale() is the only thing that sets the
|
||||
// canvas's displayed size and _scale in the same call. Turn it off and _scale is pinned at 1 while
|
||||
// the canvas is displayed at some other size, which doubled every coordinate on 2026-08-01.
|
||||
rfb.resizeSession = false;
|
||||
rfb.scaleViewport = true;
|
||||
rfb.focusOnClick = true;
|
||||
// noVNC hides the browser's own cursor over the canvas and draws the REMOTE cursor in its place.
|
||||
|
||||
Reference in New Issue
Block a user