diff --git a/app/ui.js b/app/ui.js index e9be3281..37e30413 100644 --- a/app/ui.js +++ b/app/ui.js @@ -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'); diff --git a/core/rfb.js b/core/rfb.js index 6bbf61b0..1f5d964d 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -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); } diff --git a/docs/API.md b/docs/API.md index e8fe0556..a70f1916 100644 --- a/docs/API.md +++ b/docs/API.md @@ -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. diff --git a/vnc.html b/vnc.html index e2799d6e..76314e58 100644 --- a/vnc.html +++ b/vnc.html @@ -221,10 +221,6 @@
  • Advanced