[Spice-devel] [PATCH](resend) [spice-html5] Add the scroll to the cursor offset

Aric Stewart aric at codeweavers.com
Thu Aug 9 09:25:43 PDT 2012


Checking with a more complaint browser proves that scrollLeft is also needed.

Signed-off-by: Aric Stewart <aric at codeweavers.com>
---
 spicemsg.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/spicemsg.js b/spicemsg.js
index 41b001d..79c76bc 100644
--- a/spicemsg.js
+++ b/spicemsg.js
@@ -639,8 +639,8 @@ 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;
-        this.y = e.clientY - sc.display.surfaces[sc.display.primary_surface].canvas.offsetTop;
+        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;
         sc.mousex = this.x;
         sc.mousey = this.y;      }
-- 
1.7.7.5 (Apple Git-26)




More information about the Spice-devel mailing list