diff --git a/guacamole/src/main/webapp/app/client/directives/guacClient.js b/guacamole/src/main/webapp/app/client/directives/guacClient.js index c5f7bcd35..8c330805a 100644 --- a/guacamole/src/main/webapp/app/client/directives/guacClient.js +++ b/guacamole/src/main/webapp/app/client/directives/guacClient.js @@ -115,6 +115,13 @@ angular.module('client').directive('guacClient', [function guacClient() { */ var main = $element[0]; + /** + * The element which functions as a detector for size changes. + * + * @type Element + */ + var resizeSensor = $element.find('.resize-sensor')[0]; + /** * Guacamole mouse event object, wrapped around the main client * display. @@ -491,8 +498,8 @@ angular.module('client').directive('guacClient', [function guacClient() { $scope.clientProperties.scale = $scope.clientProperties.minScale; }); - // If the window is resized, attempt to resize client - $window.addEventListener('resize', function onResizeWindow() { + // If the element is resized, attempt to resize client + resizeSensor.contentWindow.addEventListener('resize', function mainElementResized() { // Send new display size, if changed if (client && display) { diff --git a/guacamole/src/main/webapp/app/client/styles/display.css b/guacamole/src/main/webapp/app/client/styles/display.css index 7fd44f623..a606514e4 100644 --- a/guacamole/src/main/webapp/app/client/styles/display.css +++ b/guacamole/src/main/webapp/app/client/styles/display.css @@ -32,11 +32,21 @@ div.main { overflow: auto; - position: fixed; - top: 0; - bottom: 0; - right: 0; + width: 100%; + height: 100%; + position: relative; +} + +.resize-sensor { + height: 100%; + width: 100%; + position: absolute; left: 0; + top: 0; + overflow: hidden; + border: none; + opacity: 0; + z-index: -1; } div.displayOuter { diff --git a/guacamole/src/main/webapp/app/client/templates/blank.html b/guacamole/src/main/webapp/app/client/templates/blank.html new file mode 100644 index 000000000..62b9f6aa2 --- /dev/null +++ b/guacamole/src/main/webapp/app/client/templates/blank.html @@ -0,0 +1,22 @@ + +
diff --git a/guacamole/src/main/webapp/app/client/templates/guacClient.html b/guacamole/src/main/webapp/app/client/templates/guacClient.html index 91daf3b81..30e5d606d 100644 --- a/guacamole/src/main/webapp/app/client/templates/guacClient.html +++ b/guacamole/src/main/webapp/app/client/templates/guacClient.html @@ -21,6 +21,9 @@ THE SOFTWARE. --> + + +