summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsamhed <samuel@cendio.se>2015-01-15 16:27:18 +0100
committersamhed <samuel@cendio.se>2015-01-15 16:27:18 +0100
commitb804b3e45810b54bd8f93c7df73598a1b19a19b7 (patch)
tree8c8409226b927d939d6d3045b914e9c4abd6dfbd
parentfc00821eba469641c6c94706726c3d78e46460a2 (diff)
downloadnovnc-b804b3e45810b54bd8f93c7df73598a1b19a19b7.tar.gz
Fixes #428 - hides the local cursor when using the server-side cursor.
-rw-r--r--include/display.js7
-rw-r--r--include/rfb.js5
2 files changed, 10 insertions, 2 deletions
diff --git a/include/display.js b/include/display.js
index a42b854..db45d7b 100644
--- a/include/display.js
+++ b/include/display.js
@@ -93,13 +93,14 @@ var Display;
this._cursor_uri = true;
}
Util.Info("Data URI scheme cursor supported");
+ this._target.style.cursor = curSave;
} else {
if (this._cursor_uri === null || this._cursor_uri === undefined) {
this._cursor_uri = false;
}
Util.Warn("Data URI scheme cursor not supported");
+ this._target.style.cursor = "none";
}
- this._target.style.cursor = curSave;
} catch (exc) {
Util.Error("Data URI scheme cursor test exception: " + exc);
this._cursor_uri = false;
@@ -470,6 +471,10 @@ var Display;
this._target.style.cursor = "default";
},
+ disableLocalCursor: function () {
+ this._target.style.cursor = "none";
+ },
+
// Overridden getters/setters
get_context: function () {
return this._drawCtx;
diff --git a/include/rfb.js b/include/rfb.js
index 59fd785..980e61c 100644
--- a/include/rfb.js
+++ b/include/rfb.js
@@ -411,7 +411,9 @@ var RFB;
if (this._display && this._display.get_context()) {
this._keyboard.ungrab();
this._mouse.ungrab();
- this._display.defaultCursor();
+ if (state !== 'connect' && state !== 'loaded') {
+ this._display.defaultCursor();
+ }
if (Util.get_logging() !== 'debug' || state === 'loaded') {
// Show noVNC logo on load and when disconnected, unless in
// debug mode
@@ -1215,6 +1217,7 @@ var RFB;
RFB.prototype.set_local_cursor = function (cursor) {
if (!cursor || (cursor in {'0': 1, 'no': 1, 'false': 1})) {
this._local_cursor = false;
+ this._display.disableLocalCursor(); //Only show server-side cursor
} else {
if (this._display.get_cursor_uri()) {
this._local_cursor = true;