You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by wthomas <we...@edgecaselabs.com> on 2017/03/31 21:35:18 UTC

guacamole-common-js resize method guidance

I'm writing a custom viewer using the guacamole-example. I'm attempting to
get the window to resize properly. I've found the resize method within
Guacamole.Display, but I can't seem to get it to work as I expected it to.

I'm doing something like this:

var guac = new Guacamole.Client(
                new Guacamole.HTTPTunnel("tunnel")
            );

var d = guac.getDisplay()
d.resize(d.getDefaultLayer(), 300, 300)


.... aaaannnnd nothing happens.

What am I doing wrong?



--
View this message in context: http://apache-guacamole-incubating-users.2363388.n4.nabble.com/guacamole-common-js-resize-method-guidance-tp693.html
Sent from the Apache Guacamole (incubating) - Users mailing list archive at Nabble.com.

Re: guacamole-common-js resize method guidance

Posted by wthomas <we...@edgecaselabs.com>.
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.

Re: guacamole-common-js resize method guidance

Posted by wthomas <we...@edgecaselabs.com>.
Sorry for the ridiculously large screenshot. I wasn't thinking.



--
View this message in context: http://apache-guacamole-incubating-users.2363388.n4.nabble.com/guacamole-common-js-resize-method-guidance-tp693p708.html
Sent from the Apache Guacamole (incubating) - Users mailing list archive at Nabble.com.

Re: guacamole-common-js resize method guidance

Posted by Mike Jumper <mi...@guac-dev.org>.
On Mon, Apr 3, 2017 at 9:52 AM, wthomas <we...@edgecaselabs.com> wrote:

> I need to scale the remote viewing window down so that it fits within
> `window.innerHeight`
>
> <http://apache-guacamole-incubating-users.2363388.n4.nabble.com/file/n707/
> Screenshot_2017-04-03_11.png>
>

The function you're looking for is scale():

http://guacamole.incubator.apache.org/doc/guacamole-common-js/Guacamole.Display.html#scale

You will need to calculate the scale factor yourself initially and when the
window changes size.

The resize() function you were using previously will resize individual
layers, clipping the contents of that layer. It doesn't perform scaling,
but rather the same resize operation that the Guacamole protocol's "size"
instruction uses. It is a drawing operation which directly modifies display
state, unlike scale() which only affects how the display appears.

- Mike

Re: guacamole-common-js resize method guidance

Posted by wthomas <we...@edgecaselabs.com>.
I need to scale the remote viewing window down so that it fits within
`window.innerHeight`

<http://apache-guacamole-incubating-users.2363388.n4.nabble.com/file/n707/Screenshot_2017-04-03_11.png> 





--
View this message in context: http://apache-guacamole-incubating-users.2363388.n4.nabble.com/guacamole-common-js-resize-method-guidance-tp693p707.html
Sent from the Apache Guacamole (incubating) - Users mailing list archive at Nabble.com.

Re: guacamole-common-js resize method guidance

Posted by Mike Jumper <mi...@guac-dev.org>.
On Fri, Mar 31, 2017 at 2:35 PM, wthomas <we...@edgecaselabs.com> wrote:

> I'm writing a custom viewer using the guacamole-example. I'm attempting to
> get the window to resize properly.


What window are you referring to?

Resize in what way?

- Mike