guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cathy Huang <lu_hua...@163.com>
Subject Scaling strategy for RDP on Retina and other 2x screen
Date Mon, 27 Aug 2018 10:52:39 GMT
Hi. 
I am building a remote desktop application based on guacamole-common-js and
guacamole-lite(a nodejs-based guacamole-common implementation). The version
of guacamole is 0.9.13-incubating.

I have a resolution problem when opening an RDP-connection on Retina screen. 

```
function getConnectionString (token) {
  var pixel_density = window.devicePixelRatio || 1;
  var optimal_dpi = pixel_density * 96;
  var optimal_width = window.innerWidth * pixel_density; // on retina screen
it's twice the width of window.innerWidth
  var optimal_height = window.innerHeight * pixel_density;
  return ("token=" + token
    + "&width="       + Math.floor(optimal_width)
    + "&height="      + Math.floor(optimal_height)
    + "&dpi="         + Math.floor(optimal_dpi)

...

client.connect(getConnectionString(token))

```

The resulted canvas is beyond the viewport because the received image is
twice as big as the window. So I call `client.getDisplay().scale(0.5)` to
scale the display. Then the wrapper of canvas shrinks to fit the window. The
icons and texts on the canvas are difficult to discern because they are now
half of the original size.

<http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/file/t706/t01c53e7c3267d0f517.png>



However I found that the official demo is fine on Retina screen. I checked
the canvas' width in chrome dev-tool. It neither equals to
`window.innerWidth * pixel_density` nor `window.innerWidth`. As shown below. 

<http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/file/t706/t01d84d55d86d97306a.png>


PS: I didn't resize the window at all.

Does the official demo's server implementation do anything to resize the
image before sending to the browser? Or did I miss something when I set up
the connection? How can I get the same effect as the official demo do? 



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

Mime
View raw message