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>
This commit is contained in:
Cédric Bosdonnat 2019-02-14 10:44:54 +01:00 committed by Jeremy White
parent ee0ec7c24f
commit 7b8f595b8f

View File

@ -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;
}
}