diff --git a/src/workspaces/officerdev/src/apps/Desktop/DesktopView.tsx b/src/workspaces/officerdev/src/apps/Desktop/DesktopView.tsx index 202eaacc..bcc6e906 100644 --- a/src/workspaces/officerdev/src/apps/Desktop/DesktopView.tsx +++ b/src/workspaces/officerdev/src/apps/Desktop/DesktopView.tsx @@ -139,8 +139,14 @@ export const DesktopView = ({ className, style }: DesktopViewProps) => { credentials: { password }, }); + // resizeSession WITHOUT scaleViewport. They are alternatives, not complements: resizeSession asks + // the server to become the container's size, scaleViewport scales whatever the server sends to fit. + // Xvnc implements RandR SetDesktopSize, so the session really does become the container size and + // there is nothing left to scale. With both enabled any gap between the size requested and the size + // granted leaves a fractional scale that pointer coordinates are mapped through — which is how the + // cursor ended up offset from where you clicked. One strategy, 1:1 pixels, no coordinate maths. rfb.resizeSession = true; - rfb.scaleViewport = true; + rfb.scaleViewport = false; rfb.focusOnClick = true; rfbRef.current = rfb;