diff --git a/include/ui.js b/include/ui.js index 83a5e22e..8f922874 100644 --- a/include/ui.js +++ b/include/ui.js @@ -73,7 +73,7 @@ load: function() { UI.setMouseButton(); // Remove the address bar setTimeout(function() { window.scrollTo(0, 1); }, 100); - UI.initSetting('clip', true); + UI.forceSetting('clip', true); $D('noVNC_clip').disabled = true; } else { UI.initSetting('clip', false); @@ -177,6 +177,12 @@ initSetting: function(name, defVal) { return val; }, +// Force a setting to be a certain value +forceSetting: function(name, val) { + UI.updateSetting(name, val); + return val; +}, + // Show the clipboard panel toggleClipboardPanel: function() { @@ -392,9 +398,11 @@ updateVisualState: function() { if (connected) { UI.setViewClip(); UI.setMouseButton(1); + $D('showKeyboard').style.display = "inline"; $D('sendCtrlAltDelButton').style.display = "inline"; } else { UI.setMouseButton(); + $D('showKeyboard').style.display = "none"; $D('sendCtrlAltDelButton').style.display = "none"; } // State change disables viewport dragging. @@ -495,8 +503,8 @@ setViewClip: function(clip) { cur_clip = display.get_viewport(); - if (typeof(clip) !== 'undefined') { - // Nothing + if (typeof(clip) !== 'boolean') { + // Use current setting clip = UI.getSetting('clip'); } diff --git a/vnc.html b/vnc.html index 17bf6e4f..c412c70d 100644 --- a/vnc.html +++ b/vnc.html @@ -70,7 +70,8 @@ id="showKeyboard" class="noVNC_status_button" value="Keyboard" title="Show Keyboard" onclick="UI.showKeyboard()"/> -