From d1496d7375cb6ca422690522d88a85065f17d73d Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 23 Feb 2012 11:22:15 -0800 Subject: [PATCH] Update cursor position when cursor image/hotspot is updated. --- guacamole-common-js/src/main/resources/guacamole.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/guacamole-common-js/src/main/resources/guacamole.js b/guacamole-common-js/src/main/resources/guacamole.js index 7f474ac83..ea5f87508 100644 --- a/guacamole-common-js/src/main/resources/guacamole.js +++ b/guacamole-common-js/src/main/resources/guacamole.js @@ -123,6 +123,9 @@ Guacamole.Client = function(tunnel) { var cursorHotspotX = 0; var cursorHotspotY = 0; + var cursorX = 0; + var cursorY = 0; + function moveCursor(x, y) { var element = cursor.getElement(); @@ -131,6 +134,10 @@ Guacamole.Client = function(tunnel) { element.style.left = (x - cursorHotspotX) + "px"; element.style.top = (y - cursorHotspotY) + "px"; + // Update stored position + cursorX = x; + cursorY = y; + } guac_client.getDisplay = function() { @@ -440,7 +447,8 @@ Guacamole.Client = function(tunnel) { 0 ); - // FIXME: Update cursor position when hotspot changes + // Update cursor position (hotspot may have changed) + moveCursor(cursorX, cursorY); },