import * as Log from './util/logging.js';
import { decodeUTF8 } from './util/strings.js';
-import { supportsCursorURIs, isTouchDevice } from './util/browser.js';
import EventTargetMixin from './util/eventtarget.js';
import Display from "./display.js";
import Keyboard from "./input/keyboard.js";
import Mouse from "./input/mouse.js";
+import Cursor from "./util/cursor.js";
import Websock from "./websock.js";
import DES from "./des.js";
import KeyTable from "./input/keysym.js";
this._canvas.tabIndex = -1;
this._screen.appendChild(this._canvas);
+ this._cursor = new Cursor();
+
// populate encHandlers with bound versions
this._encHandlers[encodings.encodingRaw] = RFB.encodingHandlers.RAW.bind(this);
this._encHandlers[encodings.encodingCopyRect] = RFB.encodingHandlers.COPYRECT.bind(this);
// Make our elements part of the page
this._target.appendChild(this._screen);
+ this._cursor.attach(this._canvas);
+
// Monitor size changes of the screen
// FIXME: Use ResizeObserver, or hidden overflow
window.addEventListener('resize', this._eventHandlers.windowResize);
_disconnect: function () {
Log.Debug(">> RFB.disconnect");
+ this._cursor.detach();
this._canvas.removeEventListener("mousedown", this._eventHandlers.focusCanvas);
this._canvas.removeEventListener("touchstart", this._eventHandlers.focusCanvas);
window.removeEventListener('resize', this._eventHandlers.windowResize);
serverSupportedTunnelTypes[cap_code] = { vendor: cap_vendor, signature: cap_signature };
}
+ Log.Debug("Server Tight tunnel types: " + serverSupportedTunnelTypes);
+
+ // Siemens touch panels have a VNC server that supports NOTUNNEL,
+ // but forgets to advertise it. Try to detect such servers by
+ // looking for their custom tunnel type.
+ if (serverSupportedTunnelTypes[1] &&
+ (serverSupportedTunnelTypes[1].vendor === "SICR") &&
+ (serverSupportedTunnelTypes[1].signature === "SCHANNEL")) {
+ Log.Debug("Detected Siemens server. Assuming NOTUNNEL support.");
+ serverSupportedTunnelTypes[0] = { vendor: 'TGHT', signature: 'NOTUNNEL' };
+ }
+
// choose the notunnel type
if (serverSupportedTunnelTypes[0]) {
if (serverSupportedTunnelTypes[0].vendor != clientSupportedTunnelTypes[0].vendor ||
return this._fail("Client's tunnel type had the incorrect " +
"vendor or signature");
}
+ Log.Debug("Selected tunnel type: " + clientSupportedTunnelTypes[0]);
this._sock.send([0, 0, 0, 0]); // use NOTUNNEL
return false; // wait until we receive the sub auth count to continue
} else {
serverSupportedTypes.push(capabilities);
}
+ Log.Debug("Server Tight authentication types: " + serverSupportedTypes);
+
for (let authType in clientSupportedTypes) {
if (serverSupportedTypes.indexOf(authType) != -1) {
this._sock.send([0, 0, 0, clientSupportedTypes[authType]]);
+ Log.Debug("Selected authentication type: " + authType);
switch (authType) {
case 'STDVNOAUTH__': // no auth
this._timing.fbu_rt_start = (new Date()).getTime();
this._timing.pixels = 0;
- // Cursor will be server side until the server decides to honor
- // our request and send over the cursor image
- this._display.disableLocalCursor();
-
this._updateConnectionState('connected');
return true;
},
encs.push(encodings.pseudoEncodingFence);
encs.push(encodings.pseudoEncodingContinuousUpdates);
- if (supportsCursorURIs() &&
- !isTouchDevice && this._fb_depth == 24) {
+ if (this._fb_depth == 24) {
encs.push(encodings.pseudoEncodingCursor);
}
this._FBU.bytes = pixelslength + masklength;
if (this._sock.rQwait("cursor encoding", this._FBU.bytes)) { return false; }
- this._display.changeCursor(this._sock.rQshiftBytes(pixelslength),
- this._sock.rQshiftBytes(masklength),
- x, y, w, h);
+ this._cursor.change(this._sock.rQshiftBytes(pixelslength),
+ this._sock.rQshiftBytes(masklength),
+ x, y, w, h);
this._FBU.bytes = 0;
this._FBU.rects--;