Update cursor position when cursor image/hotspot is updated.

This commit is contained in:
Michael Jumper
2012-02-23 11:22:15 -08:00
parent 4e91f312ed
commit d1496d7375

View File

@@ -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);
},