Commit 9b9e741b authored by samhed's avatar samhed

On touch devices the default should be to use a remote cursor.

parent 97aefe5f
...@@ -24,6 +24,7 @@ connSettingsOpen : false, ...@@ -24,6 +24,7 @@ connSettingsOpen : false,
popupStatusOpen : false, popupStatusOpen : false,
clipboardOpen: false, clipboardOpen: false,
keyboardVisible: false, keyboardVisible: false,
isTouchDevice: false,
// Setup rfb object, load settings from browser storage, then call // Setup rfb object, load settings from browser storage, then call
// UI.init to setup the UI/menus // UI.init to setup the UI/menus
...@@ -35,6 +36,8 @@ load: function (callback) { ...@@ -35,6 +36,8 @@ load: function (callback) {
start: function(callback) { start: function(callback) {
var html = '', i, sheet, sheets, llevels, port; var html = '', i, sheet, sheets, llevels, port;
UI.isTouchDevice = 'ontouchstart' in document.documentElement;
// Stylesheet selection dropdown // Stylesheet selection dropdown
sheet = WebUtil.selectStylesheet(); sheet = WebUtil.selectStylesheet();
sheets = WebUtil.getStylesheets(); sheets = WebUtil.getStylesheets();
...@@ -75,7 +78,7 @@ start: function(callback) { ...@@ -75,7 +78,7 @@ start: function(callback) {
UI.initSetting('password', ''); UI.initSetting('password', '');
UI.initSetting('encrypt', (window.location.protocol === "https:")); UI.initSetting('encrypt', (window.location.protocol === "https:"));
UI.initSetting('true_color', true); UI.initSetting('true_color', true);
UI.initSetting('cursor', true); UI.initSetting('cursor', !UI.isTouchDevice);
UI.initSetting('shared', true); UI.initSetting('shared', true);
UI.initSetting('view_only', false); UI.initSetting('view_only', false);
UI.initSetting('connectTimeout', 2); UI.initSetting('connectTimeout', 2);
...@@ -97,7 +100,7 @@ start: function(callback) { ...@@ -97,7 +100,7 @@ start: function(callback) {
// }; // };
// Show mouse selector buttons on touch screen devices // Show mouse selector buttons on touch screen devices
if ('ontouchstart' in document.documentElement) { if (UI.isTouchDevice) {
// Show mobile buttons // Show mobile buttons
$D('noVNC_mobile_buttons').style.display = "inline"; $D('noVNC_mobile_buttons').style.display = "inline";
UI.setMouseButton(); UI.setMouseButton();
...@@ -356,8 +359,8 @@ toggleSettingsPanel: function() { ...@@ -356,8 +359,8 @@ toggleSettingsPanel: function() {
if (UI.rfb.get_display().get_cursor_uri()) { if (UI.rfb.get_display().get_cursor_uri()) {
UI.updateSetting('cursor'); UI.updateSetting('cursor');
} else { } else {
UI.updateSetting('cursor', true); UI.updateSetting('cursor', !UI.isTouchDevice);
$D('noVNC_cursor').disabled = false; $D('noVNC_cursor').disabled = true;
} }
UI.updateSetting('clip'); UI.updateSetting('clip');
UI.updateSetting('shared'); UI.updateSetting('shared');
...@@ -518,8 +521,8 @@ updateVisualState: function() { ...@@ -518,8 +521,8 @@ updateVisualState: function() {
UI.rfb.get_display().get_cursor_uri()) { UI.rfb.get_display().get_cursor_uri()) {
$D('noVNC_cursor').disabled = connected; $D('noVNC_cursor').disabled = connected;
} else { } else {
UI.updateSetting('cursor', true); UI.updateSetting('cursor', !UI.isTouchDevice);
$D('noVNC_cursor').disabled = false; $D('noVNC_cursor').disabled = true;
} }
$D('noVNC_shared').disabled = connected; $D('noVNC_shared').disabled = connected;
$D('noVNC_view_only').disabled = connected; $D('noVNC_view_only').disabled = connected;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment