mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
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:
@@ -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);
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user