[spice-html5][PATCH v2 11/13] resize_helper, no message box case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The resize_handler need to check for the existence of the message box
before computing it's size.
---
 src/resize.js | 21 ++++++++++++---------
 1 file 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;
+        }
     }
 
 
-- 
2.19.2

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]