GitHub user mike-jumper opened a pull request:

    https://github.com/apache/incubator-guacamole-client/pull/127

    GUACAMOLE-230: Provide oncursor event handler with canvas having exact 
dimensions

    Guacamole implements its layers using a `canvas` wrapped in a `div`, with 
that outer `div` providing the clipping area. There is thus no internal 
requirement that the `canvas` itself be the same dimensions as the layer it 
belongs to, and recent changes 
([GUACAMOLE-187](https://issues.apache.org/jira/browse/GUACAMOLE-187) via #113) 
leveraged this to reduce the number of expensive resize operations attempted 
when a layer is being continuously resized.
    
    Unfortunately, as described in 
[GUACAMOLE-230](https://issues.apache.org/jira/browse/GUACAMOLE-230):
    
    > The mouse cursor renders extremely small when set via CSS, at least on 
Chrome. This seems to be due to layer dimensions now rounding up to the nearest 
multiple of 64. On high-resolution devices, Chrome assumes that 64x64 cursor 
image must also be high-resolution, and uses a pixel size inappropriate for the 
connection. This does not occur for smaller cursor images.
    
    This change adds a new `toCanvas()` function to `Guacamole.Layer` which 
produces an entirely new canvas representing the contents of the layer. Unlike 
`getCanvas()`, which returns the internal `canvas` backing the layer itself, 
`toCanvas()` is guaranteed to return an entirely independent `canvas` which has 
the same dimensions as the layer. By using `toCanvas()` rather than 
`getCanvas()` when invoking the `oncursor` handler, cursors now work as they 
did previously.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mike-jumper/incubator-guacamole-client 
cursor-resolution

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-guacamole-client/pull/127.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #127
    
----
commit c2f7fdb61d49ce14f599dc728f70fab1d164b5aa
Author: Michael Jumper <[email protected]>
Date:   2017-03-05T04:33:57Z

    GUACAMOLE-230: Provide means of retrieving a canvas with the same 
dimensions and content as a layer.

commit 69ff583a07c6644f75cd404c2c94a16489b88b3b
Author: Michael Jumper <[email protected]>
Date:   2017-03-05T04:36:24Z

    GUACAMOLE-230: Supply oncursor event with new canvas (having correct 
dimensions).

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to