mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
Update cursor position when cursor image/hotspot is updated.
This commit is contained in:
@@ -123,6 +123,9 @@ Guacamole.Client = function(tunnel) {
|
|||||||
var cursorHotspotX = 0;
|
var cursorHotspotX = 0;
|
||||||
var cursorHotspotY = 0;
|
var cursorHotspotY = 0;
|
||||||
|
|
||||||
|
var cursorX = 0;
|
||||||
|
var cursorY = 0;
|
||||||
|
|
||||||
function moveCursor(x, y) {
|
function moveCursor(x, y) {
|
||||||
|
|
||||||
var element = cursor.getElement();
|
var element = cursor.getElement();
|
||||||
@@ -131,6 +134,10 @@ Guacamole.Client = function(tunnel) {
|
|||||||
element.style.left = (x - cursorHotspotX) + "px";
|
element.style.left = (x - cursorHotspotX) + "px";
|
||||||
element.style.top = (y - cursorHotspotY) + "px";
|
element.style.top = (y - cursorHotspotY) + "px";
|
||||||
|
|
||||||
|
// Update stored position
|
||||||
|
cursorX = x;
|
||||||
|
cursorY = y;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
guac_client.getDisplay = function() {
|
guac_client.getDisplay = function() {
|
||||||
@@ -440,7 +447,8 @@ Guacamole.Client = function(tunnel) {
|
|||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
// FIXME: Update cursor position when hotspot changes
|
// Update cursor position (hotspot may have changed)
|
||||||
|
moveCursor(cursorX, cursorY);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user