summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mannehed <samuel@cendio.se>2016-09-01 15:03:39 +0200
committerSamuel Mannehed <samuel@cendio.se>2016-10-14 01:46:14 +0200
commit81bd2d6682ea176ff083b252c80d34d98d8f9606 (patch)
treeac0ca29f37adaf2226c1184c53b4686a86a49f96
parentda346c3b212318bdcaae9febbe14dce0d2d260c0 (diff)
downloadnovnc-81bd2d6682ea176ff083b252c80d34d98d8f9606.tar.gz
Don't grab keyboard or mouse in view-only mode
Fixes #644.
-rw-r--r--core/rfb.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/rfb.js b/core/rfb.js
index ca173ea..4a5f434 100644
--- a/core/rfb.js
+++ b/core/rfb.js
@@ -415,8 +415,8 @@
}
if (this._display && this._display.get_context()) {
- this._keyboard.ungrab();
- this._mouse.ungrab();
+ if (!this._view_only) { this._keyboard.ungrab(); }
+ if (!this._view_only) { this._mouse.ungrab(); }
this._display.defaultCursor();
if (Util.get_logging() !== 'debug') {
// Show noVNC logo on load and when disconnected, unless in
@@ -1028,8 +1028,9 @@
this._display.set_true_color(this._true_color);
this._display.resize(this._fb_width, this._fb_height);
this._onFBResize(this, this._fb_width, this._fb_height);
- this._keyboard.grab();
- this._mouse.grab();
+
+ if (!this._view_only) { this._keyboard.grab(); }
+ if (!this._view_only) { this._mouse.grab(); }
if (this._true_color) {
this._fb_Bpp = 4;