diff --git a/guacamole-common-js/src/main/resources/guacamole.js b/guacamole-common-js/src/main/resources/guacamole.js index 5ffaee0a9..e2384c52e 100644 --- a/guacamole-common-js/src/main/resources/guacamole.js +++ b/guacamole-common-js/src/main/resources/guacamole.js @@ -463,6 +463,16 @@ Guacamole.Client = function(tunnel) { */ this.onclipboard = null; + /** + * Fired when the default layer (and thus the entire Guacamole display) + * is resized. + * + * @event + * @param {Number} width The new width of the Guacamole display. + * @param {Number} height The new height of the Guacamole display. + */ + this.onresize = null; + // Layers function getBufferLayer(index) { @@ -954,6 +964,10 @@ Guacamole.Client = function(tunnel) { bounds.style.width = (displayWidth*displayScale) + "px"; bounds.style.height = (displayHeight*displayScale) + "px"; + // Call resize event handler if defined + if (guac_client.onresize) + guac_client.onresize(width, height); + } } @@ -1134,6 +1148,14 @@ Guacamole.Client = function(tunnel) { }; + this.getWidth = function() { + return displayWidth; + }; + + this.getHeight = function() { + return displayHeight; + }; + this.getScale = function() { return displayScale; };