From c307d966d58dd69bfdb72086f47eb35e8c47eb0b Mon Sep 17 00:00:00 2001 From: jalf Date: Tue, 29 Jan 2013 10:44:01 +0100 Subject: [PATCH] allow RFB conf to specify default cursor --- include/display.js | 5 +++-- include/rfb.js | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/display.js b/include/display.js index 9f2d6b89..1fac6127 100644 --- a/include/display.js +++ b/include/display.js @@ -55,7 +55,8 @@ Util.conf_defaults(conf, that, defaults, [ ['render_mode', 'ro', 'str', '', 'Canvas rendering mode (read-only)'], ['prefer_js', 'rw', 'str', null, 'Prefer Javascript over canvas methods'], - ['cursor_uri', 'rw', 'raw', null, 'Can we render cursor using data URI'] + ['cursor_uri', 'rw', 'raw', null, 'Can we render cursor using data URI'], + ['default_cursor', 'wo', 'str', null, 'Default cursor'] ]); // Override some specific getters/setters @@ -648,7 +649,7 @@ that.changeCursor = function(pixels, mask, hotx, hoty, w, h) { }; that.defaultCursor = function() { - conf.target.style.cursor = "default"; + conf.target.style.cursor = conf.default_cursor; }; return constructor(); // Return the public API interface diff --git a/include/rfb.js b/include/rfb.js index b7be99f8..e7805dbe 100644 --- a/include/rfb.js +++ b/include/rfb.js @@ -142,6 +142,8 @@ Util.conf_defaults(conf, that, defaults, [ ['connectTimeout', 'rw', 'int', def_con_timeout, 'Time (s) to wait for connection'], ['disconnectTimeout', 'rw', 'int', 3, 'Time (s) to wait for disconnection'], + ['default_cursor', 'wo', 'str', 'default', 'Default cursor'], + // UltraVNC repeater ID to connect to ['repeaterID', 'rw', 'str', '', 'RepeaterID to connect to'], @@ -214,7 +216,7 @@ function constructor() { } // Initialize display, mouse, keyboard, and websock try { - display = new Display({'target': conf.target}); + display = new Display({'target': conf.target, 'default_cursor': conf.default_cursor}); } catch (exc) { Util.Error("Display exception: " + exc); updateState('fatal', "No working Display");