diff options
author | Cédric Bosdonnat <cbosdonnat@suse.com> | 2019-02-14 10:44:54 +0100 |
---|---|---|
committer | Jeremy White <jwhite@codeweavers.com> | 2019-02-14 12:46:11 -0600 |
commit | 7b8f595b8f5a58c2be472001e4afaa8be50b56ad (patch) | |
tree | 9e5b73c84e82687c681234ddcd641fd21abcd6f9 | |
parent | ee0ec7c24f079417fe9fe78ce7890d063dd077f6 (diff) |
resize_helper, no message box case
The resize_handler need to check for the existence of the message box
before computing it's size.
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
-rw-r--r-- | src/resize.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/resize.js b/src/resize.js index 32282fd..c8d87d9 100644 --- a/src/resize.js +++ b/src/resize.js @@ -42,16 +42,19 @@ function resize_helper(sc) var h = window.innerHeight - 20; /* Screen height based on debug console visibility */ - if (window.getComputedStyle(m).getPropertyValue("display") == 'none') + if (m != null) { - /* Get console height from spice.css .spice-message */ - var mh = parseInt(window.getComputedStyle(m).getPropertyValue("height"), 10); - h = h - mh; - } - else - { - /* Show both div elements - spice-area and message-div */ - h = h - m.offsetHeight - m.clientHeight; + if (window.getComputedStyle(m).getPropertyValue("display") == 'none') + { + /* Get console height from spice.css .spice-message */ + var mh = parseInt(window.getComputedStyle(m).getPropertyValue("height"), 10); + h = h - mh; + } + else + { + /* Show both div elements - spice-area and message-div */ + h = h - m.offsetHeight - m.clientHeight; + } } |