guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marko Nikolić (JIRA) <>
Subject [jira] [Created] (GUACAMOLE-164) guacViewport invalid height calculation
Date Sun, 22 Jan 2017 20:21:26 GMT
Marko Nikolić created GUACAMOLE-164:

             Summary: guacViewport invalid height calculation
                 Key: GUACAMOLE-164
             Project: Guacamole
          Issue Type: Bug
          Components: guacamole-client
    Affects Versions: 0.9.10-incubating
         Environment: chrome firefox
            Reporter: Marko Nikolić

There is a problem when the Guacamole application is not occupying the whole window and there
are some elements inserted above Guacamole application. The issue can be seen in Firefox and
possible in other browser, because the available height is not calculated in a cross-browser

{{guacViewport}} directive calculates browser area height and based on results sets height
of the viewport. The calculation is made in {{fitVisibleArea()}} function, in the following

var scrollHeight = document.body.scrollHeight;

However, {{scrollHeight}} does not return same values cross-browser. In Chrome, it works as
expected (from the Guacamole perspective), but different value is returned in Firefox. Different
behaviour is not visible when the Guacamole client is occupying the whole window, only when
there are some elements above.

I have fixed the problem by calculating the height in {{guacViewport}} using function from

function getDocHeight() {
    var D = document;
    return Math.max(
        D.body.scrollHeight, D.documentElement.scrollHeight,
        D.body.offsetHeight, D.documentElement.offsetHeight,
        D.body.clientHeight, D.documentElement.clientHeight

Further details on the cross-browser issue can be found here:

This message was sent by Atlassian JIRA

View raw message