You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by "Michael Jumper (JIRA)" <ji...@apache.org> on 2018/04/02 19:49:00 UTC

[jira] [Commented] (GUACAMOLE-534) Mouse cursor goes out of sync when VNC display is scaled

    [ https://issues.apache.org/jira/browse/GUACAMOLE-534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16423043#comment-16423043 ] 

Michael Jumper commented on GUACAMOLE-534:
------------------------------------------

This is not a bug. When sending mouse events via {{sendMouseState()}}, you will need to manually scale those coordinates if the coordinates come from a source that is unaffected by display scale (like a {{Guacamole.Mouse}} instance). You can see this done in practice within the mainline Guacamole webapp:

[https://github.com/apache/guacamole-client/blob/3d51a469ba94e6539a9126c046a8fc4341084006/guacamole/src/main/webapp/app/client/directives/guacClient.js#L188-L209]

Universally scaling the coordinates as suggested in [^scaleFix.diff] will actually break things, as it assumes that mouse coordinates are always tied to the display scale. This is not a safe assumption in context of the general nature of guacamole-common-js (coordinates may well be generated programmatically).

The inputs to {{sendMouseState()}} should always be in the coordinate system of the remote desktop, not local coordinates.

> Mouse cursor goes out of sync when VNC display is scaled
> --------------------------------------------------------
>
>                 Key: GUACAMOLE-534
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-534
>             Project: Guacamole
>          Issue Type: Bug
>          Components: guacamole-common-js
>            Reporter: Charitha Dandeniya Arachchige
>            Priority: Minor
>         Attachments: scaleFix.diff
>
>
> I'm using guacamole-common-js to write a JS client to connect to a remote desktop via VNC protocol. Following is the code I use to add Guacamole client to the display div. I'm using the scale() function to scale the VNC window. 
> var display = document.getElementById("display");
> var guac = new Guacamole.Client(new Guacamole.HTTPTunnel("tunnel"));
> display.appendChild(guac.getDisplay().getElement());
> display.scale(0.9);
> When I do this the mouse cursor is going out of sync. There is a gap between the actual cursor and the remote cursor. I could fix this by correcting the mouse position in the sendMouseState() function of Client module. I have attached the scaleFix.diff file which includes this fix. I hope this would be useful.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)