guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "McRoy, Jeffrey (GE Healthcare)" <>
Subject Re: guacamole-common-js resize method guidance
Date Fri, 16 Feb 2018 17:33:11 GMT
Hi wthomas,

I'm also trying to add resizing to the guacamole-example. Here's what I tried and the issues
I have. Were you able to get yours working?

I added a javascript function to handle updating the guac display scale:
function rescale(browserDisp, guacDisp) {
	var scale = Math.min(browserDisp.offsetWidth / Math.max(guacDisp.getWidth(), 1),
                            browserDisp.offsetHeight / Math.max(guacDisp.getHeight(), 1));

I then added a listener for the browser resize:
var display = document.getElementById("display");
var guac = new Guacamole.Client(new Guacamole.HTTPTunnel("tunnel"));
var guacDisplay = guac.getDisplay();
rescale(display, guacDisplay);
window.onresize = function(event) {
	rescale(display, guacDisplay);

I’ve hit a couple of issues:
- Calculating the initial scale, Guacamole.Display.getHeight() and Guacamole.Display.getWidth()
return 0 until the browser window is resized. This causes the first attempt at caluclating
scale to be 0.
- In VNC the local mouse location seems to be off from the remote mouse locatipn, maybe need
scaling applied here also?
Thanks & Regards,

On 4/5/17, 4:57 PM, "wthomas" <> wrote:

    Anyone have any guidance on how to resize the guac viewer display so it
    doesn't fill beyond my entire browser window?
    View this message in context:
    Sent from the Apache Guacamole (incubating) - Users mailing list archive at

View raw message