From 81bd2d6682ea176ff083b252c80d34d98d8f9606 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Thu, 1 Sep 2016 15:03:39 +0200 Subject: [PATCH] Don't grab keyboard or mouse in view-only mode Fixes #644. --- core/rfb.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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;