Merge pull request #16 from glyptodon/send-element-size

GUAC-898: Send new display size to Guacamole when window size changes.
This commit is contained in:
James Muehlner
2014-12-07 11:20:35 -08:00

View File

@@ -427,7 +427,21 @@ angular.module('client').directive('guacClient', [function guacClient() {
// If the window is resized, attempt to resize client
$window.addEventListener('resize', function onResizeWindow() {
// Send new display size, if changed
if (client && display) {
var pixelDensity = $window.devicePixelRatio || 1;
var width = main.offsetWidth * pixelDensity;
var height = main.offsetHeight * pixelDensity;
if (display.getWidth() !== width || display.getHeight() !== height)
client.sendSize(width, height);
}
$scope.safeApply(updateDisplayScale);
});
/*