diff --git a/guacamole/src/main/webapp/client.xhtml b/guacamole/src/main/webapp/client.xhtml index a97711d57..416a20791 100644 --- a/guacamole/src/main/webapp/client.xhtml +++ b/guacamole/src/main/webapp/client.xhtml @@ -117,8 +117,8 @@ // 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 = Math.floor(optimal_width * scale); - optimal_height = Math.floor(optimal_height * scale); + optimal_width = optimal_width * scale; + optimal_height = optimal_height * scale; } // Get entire query string, and pass to connect(). @@ -128,9 +128,9 @@ var connect_string = window.location.search.substring(1) - + "&width=" + optimal_width - + "&height=" + optimal_height - + "&dpi=" + optimal_dpi; + + "&width=" + Math.floor(optimal_width) + + "&height=" + Math.floor(optimal_height) + + "&dpi=" + Math.floor(optimal_dpi); // Add audio mimetypes to connect_string GuacUI.Audio.supported.forEach(function(mimetype) { diff --git a/guacamole/src/main/webapp/scripts/client-ui.js b/guacamole/src/main/webapp/scripts/client-ui.js index 061663438..0fa6e771f 100644 --- a/guacamole/src/main/webapp/scripts/client-ui.js +++ b/guacamole/src/main/webapp/scripts/client-ui.js @@ -618,6 +618,7 @@ GuacUI.Client.updateDisplayScale = function() { // Currently attacched client var guac = GuacUI.Client.attachedClient; + var adjusted_scale = 1 / (window.devicePixelRatio || 1); // If auto-fit is enabled, scale display if (!GuacUI.Client.overrideAutoFit @@ -630,14 +631,14 @@ GuacUI.Client.updateDisplayScale = function() { ); // Scale client - if (fit_scale != guac.getScale()) + if (guac.getScale() !== fit_scale) guac.scale(fit_scale); } // Otherwise, scale to 100% - else if (guac.getScale() != 1.0) - guac.scale(1.0); + else if (guac.getScale() !== adjusted_scale) + guac.scale(adjusted_scale); };