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));
guacDisp.scale(scale);
}
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);
display.appendChild(guacDisplay.getElement());
.
.
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,
Jeff
On 4/5/17, 4:57 PM, "wthomas" <[email protected]> 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:
http://apache-guacamole-incubating-users.2363388.n4.nabble.com/guacamole-common-js-resize-method-guidance-tp693p738.html
Sent from the Apache Guacamole (incubating) - Users mailing list archive at
Nabble.com.
smime.p7s
Description: S/MIME cryptographic signature
