diff --git a/guacamole/src/main/webapp/client.xhtml b/guacamole/src/main/webapp/client.xhtml index 05b12633d..9e859850a 100644 --- a/guacamole/src/main/webapp/client.xhtml +++ b/guacamole/src/main/webapp/client.xhtml @@ -141,6 +141,17 @@ try { + // Calculate optimal width/height for display + var optimal_width = window.innerWidth; + var optimal_height = window.innerHeight; + + // Scale width/height to be at least 600x600 + if (optimal_width < 600 || optimal_height < 600) { + var scale = Math.max(600 / optimal_width, 600 / optimal_height); + optimal_width *= scale; + optimal_height *= scale; + } + // Get entire query string, and pass to connect(). // Normally, only the "id" parameter is required, but // all parameters should be preserved and passed on for @@ -148,8 +159,8 @@ var connect_string = window.location.search.substring(1) - + "&width=" + window.innerWidth - + "&height=" + window.innerHeight; + + "&width=" + optimal_width + + "&height=" + optimal_height; // Add audio mimetypes to connect_string GuacamoleUI.supportedAudio.forEach(function(mimetype) {