Force minimum 600x600 screen resolution when requesting .

This commit is contained in:
Michael Jumper
2012-10-24 11:10:38 -07:00
parent 60bacd3a25
commit 79ada6ffea

View File

@@ -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) {