Marko Nikolić created GUACAMOLE-165:
---------------------------------------
Summary: Client ratio is not calculated properly
Key: GUACAMOLE-165
URL: https://issues.apache.org/jira/browse/GUACAMOLE-165
Project: Guacamole
Issue Type: Bug
Components: guacamole-client
Affects Versions: 0.9.10-incubating
Environment: browser
Reporter: Marko Nikolić
When the Guacamole client is not occupying the whole browser window, the screen
ratio is not calculated properly. If there are some elements above client (e.g.
added from extension), the connection string height is taking optimal height
calculated using window.height. This is not correct if there are elements above
and the client is not occupying the whole area.
{code:javascript|title=ManagedClient.js}
// Calculate optimal width/height for display
var pixel_density = $window.devicePixelRatio || 1;
var optimal_dpi = pixel_density * 96;
var optimal_width = $window.innerWidth * pixel_density;
var optimal_height = $window.innerHeight * pixel_density;
// Build base connect string
var connectString =
"token=" +
encodeURIComponent(authenticationService.getCurrentToken())
+ "&GUAC_DATA_SOURCE=" + encodeURIComponent(identifier.dataSource)
+ "&GUAC_ID=" + encodeURIComponent(identifier.id)
+ "&GUAC_TYPE=" + encodeURIComponent(identifier.type)
+ "&GUAC_WIDTH=" + Math.floor(optimal_width)
+ "&GUAC_HEIGHT=" + Math.floor(optimal_height)
+ "&GUAC_DPI=" + Math.floor(optimal_dpi)
+ (connectionParameters ? '&' + connectionParameters : '');
{code}
If the GUAC_HEIGHT parameter is corrected for the size of the element above
client, the ratio is correct.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)