diff --git a/web/packages/teleport/src/DesktopSession/useDesktopSession.tsx b/web/packages/teleport/src/DesktopSession/useDesktopSession.tsx index 9863154875d7f..fb4d5b3f1e0eb 100644 --- a/web/packages/teleport/src/DesktopSession/useDesktopSession.tsx +++ b/web/packages/teleport/src/DesktopSession/useDesktopSession.tsx @@ -240,7 +240,7 @@ export default function useDesktopSession() { })); } const bmpFrame = bmpBuffer[i]; - if (ctx) { + if (ctx && bmpFrame.image_data.data.length != 0) { ctx.putImageData(bmpFrame.image_data, bmpFrame.left, bmpFrame.top); } } diff --git a/web/packages/teleport/src/components/TdpClientCanvas/TdpClientCanvas.tsx b/web/packages/teleport/src/components/TdpClientCanvas/TdpClientCanvas.tsx index 38b8e846091ae..783fff54bc90e 100644 --- a/web/packages/teleport/src/components/TdpClientCanvas/TdpClientCanvas.tsx +++ b/web/packages/teleport/src/components/TdpClientCanvas/TdpClientCanvas.tsx @@ -37,8 +37,6 @@ function TdpClientCanvas(props: Props) { } = props; useEffect(() => { - // Empty dependency array ensures this runs only once after initial render. - // This code will run after the component has been mounted and the canvasRef has been assigned. const canvas = canvasRef.current; if (canvas) { // Make the canvas a focusable keyboard listener @@ -66,6 +64,7 @@ function TdpClientCanvas(props: Props) { canvas.addEventListener('focusout', onFocusOut); return () => { + console.log('!!!!canvas cleaning up!!!!!'); window.removeEventListener('resize', windowOnResize); canvas.removeEventListener('mousemove', onMouseMove); canvas.removeEventListener('contextmenu', onContextMenu); diff --git a/web/packages/teleport/src/lib/tdp/client.ts b/web/packages/teleport/src/lib/tdp/client.ts index 52a4a269b059a..2309d4382ce29 100644 --- a/web/packages/teleport/src/lib/tdp/client.ts +++ b/web/packages/teleport/src/lib/tdp/client.ts @@ -355,7 +355,7 @@ export default class Client extends EventEmitterWebAuthnSender { this.codec.decodeRdpConnectionActivated(buffer); const spec = { width: screenWidth, height: screenHeight }; this.logger.info( - `screen spec received from server ${spec.width} x ${spec.height}` + `received screen size from server (${spec.width} x ${spec.height})` ); this.initFastPathProcessor(ioChannelId, userChannelId, { @@ -625,7 +625,7 @@ export default class Client extends EventEmitterWebAuthnSender { sendClientScreenSpec(spec: ClientScreenSpec) { this.logger.info( - `requesting screen spec from client ${spec.width} x ${spec.height}` + `sending screen size to server (${spec.width}x${spec.height})` ); this.send(this.codec.encodeClientScreenSpec(spec)); }