Remove opt-in for remote cursors. Remove redundant two's complement encoding constants.

This commit is contained in:
y9048a 2025-06-02 10:56:24 +02:00
parent bce2a57bf0
commit e34a1c2354
5 changed files with 3 additions and 40 deletions

View File

@ -184,7 +184,6 @@ const UI = {
UI.initSetting('shared', true); UI.initSetting('shared', true);
UI.initSetting('bell', 'on'); UI.initSetting('bell', 'on');
UI.initSetting('view_only', false); UI.initSetting('view_only', false);
UI.initSetting('show_remote_cursor', true);
UI.initSetting('show_dot', false); UI.initSetting('show_dot', false);
UI.initSetting('path', 'websockify'); UI.initSetting('path', 'websockify');
UI.initSetting('repeaterID', ''); UI.initSetting('repeaterID', '');
@ -370,8 +369,6 @@ const UI = {
UI.addSettingChangeHandler('shared'); UI.addSettingChangeHandler('shared');
UI.addSettingChangeHandler('view_only'); UI.addSettingChangeHandler('view_only');
UI.addSettingChangeHandler('view_only', UI.updateViewOnly); UI.addSettingChangeHandler('view_only', UI.updateViewOnly);
UI.addSettingChangeHandler('show_remote_cursor');
UI.addSettingChangeHandler('show_remote_cursor', UI.updateShowRemoteCursor);
UI.addSettingChangeHandler('show_dot'); UI.addSettingChangeHandler('show_dot');
UI.addSettingChangeHandler('show_dot', UI.updateShowDotCursor); UI.addSettingChangeHandler('show_dot', UI.updateShowDotCursor);
UI.addSettingChangeHandler('host'); UI.addSettingChangeHandler('host');
@ -444,7 +441,6 @@ const UI = {
UI.disableSetting('port'); UI.disableSetting('port');
UI.disableSetting('path'); UI.disableSetting('path');
UI.disableSetting('repeaterID'); UI.disableSetting('repeaterID');
UI.disableSetting('show_remote_cursor');
// Hide the controlbar after 2 seconds // Hide the controlbar after 2 seconds
UI.closeControlbarTimeout = setTimeout(UI.closeControlbar, 2000); UI.closeControlbarTimeout = setTimeout(UI.closeControlbar, 2000);
@ -455,7 +451,6 @@ const UI = {
UI.enableSetting('port'); UI.enableSetting('port');
UI.enableSetting('path'); UI.enableSetting('path');
UI.enableSetting('repeaterID'); UI.enableSetting('repeaterID');
UI.enableSetting('show_remote_cursor');
UI.updatePowerButton(); UI.updatePowerButton();
UI.keepControlbar(); UI.keepControlbar();
} }
@ -892,7 +887,6 @@ const UI = {
UI.updateSetting('compression'); UI.updateSetting('compression');
UI.updateSetting('shared'); UI.updateSetting('shared');
UI.updateSetting('view_only'); UI.updateSetting('view_only');
UI.updateSetting('show_remote_cursor');
UI.updateSetting('path'); UI.updateSetting('path');
UI.updateSetting('repeaterID'); UI.updateSetting('repeaterID');
UI.updateSetting('logging'); UI.updateSetting('logging');
@ -1106,7 +1100,6 @@ const UI = {
UI.rfb.resizeSession = UI.getSetting('resize') === 'remote'; UI.rfb.resizeSession = UI.getSetting('resize') === 'remote';
UI.rfb.qualityLevel = parseInt(UI.getSetting('quality')); UI.rfb.qualityLevel = parseInt(UI.getSetting('quality'));
UI.rfb.compressionLevel = parseInt(UI.getSetting('compression')); UI.rfb.compressionLevel = parseInt(UI.getSetting('compression'));
UI.rfb.showRemoteCursor = UI.getSetting('show_remote_cursor');
UI.rfb.showDotCursor = UI.getSetting('show_dot'); UI.rfb.showDotCursor = UI.getSetting('show_dot');
UI.updateViewOnly(); // requires UI.rfb UI.updateViewOnly(); // requires UI.rfb
@ -1761,11 +1754,6 @@ const UI = {
} }
}, },
updateShowRemoteCursor () {
if (!UI.rfb) return;
UI.rfb.showRemoteCursor = UI.getSetting('show_remote_cursor');
},
updateShowDotCursor() { updateShowDotCursor() {
if (!UI.rfb) return; if (!UI.rfb) return;
UI.rfb.showDotCursor = UI.getSetting('show_dot'); UI.rfb.showDotCursor = UI.getSetting('show_dot');

View File

@ -22,6 +22,7 @@ export const encodings = {
pseudoEncodingQualityLevel0: -32, pseudoEncodingQualityLevel0: -32,
pseudoEncodingDesktopSize: -223, pseudoEncodingDesktopSize: -223,
pseudoEncodingLastRect: -224, pseudoEncodingLastRect: -224,
pseudoEncodingPointerPos: -232,
pseudoEncodingCursor: -239, pseudoEncodingCursor: -239,
pseudoEncodingQEMUExtendedKeyEvent: -258, pseudoEncodingQEMUExtendedKeyEvent: -258,
pseudoEncodingQEMULedEvent: -261, pseudoEncodingQEMULedEvent: -261,
@ -34,10 +35,7 @@ export const encodings = {
pseudoEncodingCompressLevel9: -247, pseudoEncodingCompressLevel9: -247,
pseudoEncodingCompressLevel0: -256, pseudoEncodingCompressLevel0: -256,
pseudoEncodingVMwareCursor: 0x574d5664, pseudoEncodingVMwareCursor: 0x574d5664,
pseudoEncodingExtendedClipboard: 0xc0a1e5ce, pseudoEncodingExtendedClipboard: 0xc0a1e5ce
pseudoEncodingRichCursor: 0xffffff11,
pseudoEncodingPointerPos: 0xffffff18,
pseudoEncodingTightPointerPos: -232
}; };
export function encodingName(num) { export function encodingName(num) {

View File

@ -413,11 +413,6 @@ export default class RFB extends EventTargetMixin {
} }
} }
get showRemoteCursor() { return this._showRemoteCursor; }
set showRemoteCursor(show) {
this._showRemoteCursor = show;
}
// ===== PUBLIC METHODS ===== // ===== PUBLIC METHODS =====
disconnect() { disconnect() {
@ -2256,6 +2251,7 @@ export default class RFB extends EventTargetMixin {
encs.push(encodings.pseudoEncodingDesktopSize); encs.push(encodings.pseudoEncodingDesktopSize);
encs.push(encodings.pseudoEncodingLastRect); encs.push(encodings.pseudoEncodingLastRect);
encs.push(encodings.pseudoEncodingPointerPos);
encs.push(encodings.pseudoEncodingQEMUExtendedKeyEvent); encs.push(encodings.pseudoEncodingQEMUExtendedKeyEvent);
encs.push(encodings.pseudoEncodingQEMULedEvent); encs.push(encodings.pseudoEncodingQEMULedEvent);
encs.push(encodings.pseudoEncodingExtendedDesktopSize); encs.push(encodings.pseudoEncodingExtendedDesktopSize);
@ -2269,12 +2265,6 @@ export default class RFB extends EventTargetMixin {
if (this._fbDepth == 24) { if (this._fbDepth == 24) {
encs.push(encodings.pseudoEncodingVMwareCursor); encs.push(encodings.pseudoEncodingVMwareCursor);
encs.push(encodings.pseudoEncodingCursor); encs.push(encodings.pseudoEncodingCursor);
encs.push(encodings.pseudoEncodingRichCursor);
}
if (this._showRemoteCursor) {
encs.push(encodings.pseudoEncodingPointerPos);
encs.push(encodings.pseudoEncodingTightPointerPos);
} }
RFB.messages.clientEncodings(this._sock, encs); RFB.messages.clientEncodings(this._sock, encs);
@ -2684,7 +2674,6 @@ export default class RFB extends EventTargetMixin {
return this._handleVMwareCursor(); return this._handleVMwareCursor();
case encodings.pseudoEncodingCursor: case encodings.pseudoEncodingCursor:
case encodings.pseudoEncodingRichCursor:
return this._handleCursor(); return this._handleCursor();
case encodings.pseudoEncodingQEMUExtendedKeyEvent: case encodings.pseudoEncodingQEMUExtendedKeyEvent:
@ -2709,7 +2698,6 @@ export default class RFB extends EventTargetMixin {
return this._handleLedEvent(); return this._handleLedEvent();
case encodings.pseudoEncodingPointerPos: case encodings.pseudoEncodingPointerPos:
case encodings.pseudoEncodingTightPointerPos:
return this._handlePointerPos(); return this._handlePointerPos();
default: default:

View File

@ -77,10 +77,6 @@ protocol stream.
if the remote session is smaller than its container, or handled if the remote session is smaller than its container, or handled
according to `clipViewport` if it is larger. Disabled by default. according to `clipViewport` if it is larger. Disabled by default.
`showRemoteCursor`
- Is a `boolean` indicating whether the remote cursor position should
be tracked. The server must support the respective pseudo encoding.
`showDotCursor` `showDotCursor`
- Is a `boolean` indicating whether a dot cursor should be shown - Is a `boolean` indicating whether a dot cursor should be shown
instead of a zero-sized or fully-transparent cursor if the server instead of a zero-sized or fully-transparent cursor if the server

View File

@ -289,13 +289,6 @@
<input id="noVNC_setting_reconnect_delay" type="number"> <input id="noVNC_setting_reconnect_delay" type="number">
</li> </li>
<li><hr></li> <li><hr></li>
<li>
<label>
<input id="noVNC_setting_show_remote_cursor" type="checkbox"
class="toggle">
Show remote cursor
</label>
</li>
<li> <li>
<label> <label>
<input id="noVNC_setting_show_dot" type="checkbox" <input id="noVNC_setting_show_dot" type="checkbox"