Provides compatibility for IE10.

Signed-off-by: Jeremy White <jwh...@codeweavers.com>
---
 spicemsg.js |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/spicemsg.js b/spicemsg.js
index 31e54a0..365fdf7 100644
--- a/spicemsg.js
+++ b/spicemsg.js
@@ -639,8 +639,11 @@ function SpiceMsgcMousePosition(sc, e)
     this.buttons_state = sc.buttons_state;
     if (e)
     {
-        this.x = e.clientX - 
sc.display.surfaces[sc.display.primary_surface].canvas.offsetLeft + 
document.body.scrollLeft;
-        this.y = e.clientY - 
sc.display.surfaces[sc.display.primary_surface].canvas.offsetTop + 
document.body.scrollTop;
+        var scrollTop = document.body.scrollTop || 
document.documentElement.scrollTop;
+        var scrollLeft = document.body.scrollLeft || 
document.documentElement.scrollLeft;
+
+        this.x = e.clientX - 
sc.display.surfaces[sc.display.primary_surface].canvas.offsetLeft + scrollLeft;
+        this.y = e.clientY - 
sc.display.surfaces[sc.display.primary_surface].canvas.offsetTop + scrollTop;
         sc.mousex = this.x;
         sc.mousey = this.y; 
     }
-- 
1.7.10.4



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

Reply via email to