diff --git a/core/rfb.js b/core/rfb.js index ca173eae..4a5f4344 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;