Remove local cursor setting

We have no reason to disable this except for touch devices, which
we can handle without having a setting for it.
This commit is contained in:
Pierre Ossman 2017-10-20 13:19:21 +02:00
parent 0460e5fdbe
commit 8d1f0a3de8
5 changed files with 4 additions and 54 deletions

View File

@ -13,7 +13,7 @@
import * as Log from '../core/util/logging.js';
import _, { l10n } from '../core/util/localization.js';
import { isTouchDevice, browserSupportsCursorURIs as cursorURIsSupported } from '../core/util/browsers.js';
import { isTouchDevice } from '../core/util/browsers.js';
import { setCapture, getPointerEvent } from '../core/util/events.js';
import KeyTable from "../core/input/keysym.js";
import keysyms from "../core/input/keysymdef.js";
@ -167,7 +167,6 @@ var UI = {
UI.initSetting('host', window.location.hostname);
UI.initSetting('port', port);
UI.initSetting('encrypt', (window.location.protocol === "https:"));
UI.initSetting('cursor', !isTouchDevice);
UI.initSetting('view_clip', false);
UI.initSetting('resize', 'off');
UI.initSetting('shared', true);
@ -378,8 +377,6 @@ var UI = {
.addEventListener('click', UI.toggleSettingsPanel);
UI.addSettingChangeHandler('encrypt');
UI.addSettingChangeHandler('cursor');
UI.addSettingChangeHandler('cursor', UI.updateLocalCursor);
UI.addSettingChangeHandler('resize');
UI.addSettingChangeHandler('resize', UI.enableDisableViewClip);
UI.addSettingChangeHandler('resize', UI.applyResizeMode);
@ -464,12 +461,6 @@ var UI = {
UI.enableDisableViewClip();
if (cursorURIsSupported() && !isTouchDevice) {
UI.enableSetting('cursor');
} else {
UI.disableSetting('cursor');
}
if (UI.connected) {
UI.disableSetting('encrypt');
UI.disableSetting('shared');
@ -885,12 +876,6 @@ var UI = {
// Refresh UI elements from saved cookies
UI.updateSetting('encrypt');
if (cursorURIsSupported()) {
UI.updateSetting('cursor');
} else {
UI.updateSetting('cursor', !isTouchDevice);
UI.disableSetting('cursor');
}
UI.updateSetting('view_clip');
UI.updateSetting('resize');
UI.updateSetting('shared');
@ -1062,7 +1047,6 @@ var UI = {
UI.closeAllPanels();
UI.closeConnectPanel();
UI.updateLocalCursor();
UI.updateViewOnly();
var url;
@ -1677,11 +1661,6 @@ var UI = {
}
},
updateLocalCursor: function() {
if (!UI.rfb) return;
UI.rfb.localCursor = UI.getSetting('cursor');
},
updateViewOnly: function() {
if (!UI.rfb) return;
UI.rfb.viewOnly = UI.getSetting('view_only');

View File

@ -13,7 +13,7 @@
import * as Log from './util/logging.js';
import _ from './util/localization.js';
import { decodeUTF8 } from './util/strings.js';
import { browserSupportsCursorURIs } from './util/browsers.js';
import { browserSupportsCursorURIs, isTouchDevice } from './util/browsers.js';
import Display from "./display.js";
import Keyboard from "./input/keyboard.js";
import Mouse from "./input/mouse.js";
@ -219,27 +219,6 @@ RFB.prototype = {
disconnectTimeout: 3,
dragViewport: false,
_localCursor: false,
get localCursor() { return this._localCursor; },
set localCursor(cursor) {
if (!cursor || (cursor in {'0': 1, 'no': 1, 'false': 1})) {
this._localCursor = false;
this._display.disableLocalCursor(); //Only show server-side cursor
} else {
if (browserSupportsCursorURIs()) {
this._localCursor = true;
} else {
Log.Warn("Browser does not support local cursor");
this._display.disableLocalCursor();
}
}
// Need to send an updated list of encodings if we are connected
if (this._rfb_connection_state === "connected") {
this._sendEncodings();
}
},
_viewOnly: false,
get viewOnly() { return this._viewOnly; },
set viewOnly(viewOnly) {
@ -1155,7 +1134,8 @@ RFB.prototype = {
encs.push(encodings.pseudoEncodingFence);
encs.push(encodings.pseudoEncodingContinuousUpdates);
if (this._localCursor && this._fb_depth == 24) {
if (browserSupportsCursorURIs() &&
!isTouchDevice && this._fb_depth == 24) {
encs.push(encodings.pseudoEncodingCursor);
}

View File

@ -16,10 +16,6 @@ protocol stream.
### Properties
`localCursor`
- Is a `boolean` indicating if a client side cursor should be
requested. Disabled by default.
`viewOnly`
- Is a `boolean` indicating if any events (e.g. key presses or mouse
movement) should be prevented from being sent to the server.

View File

@ -221,10 +221,6 @@
<li>
<div class="noVNC_expander">Advanced</div>
<div><ul>
<li>
<label><input id="noVNC_setting_cursor" type="checkbox" /> Local Cursor</label>
</li>
<li><hr></li>
<li>
<label for="noVNC_setting_repeaterID">Repeater ID:</label>
<input id="noVNC_setting_repeaterID" type="input" value="" />

View File

@ -257,7 +257,6 @@
try {
rfb = new RFB(document.getElementById('noVNC_canvas'));
rfb.localCursor = WebUtil.getConfigVar('cursor', true);
rfb.viewOnly = WebUtil.getConfigVar('view_only', false);
rfb.onnotification = notification;
rfb.onupdatestate = updateState;