View | Details | Raw Unified | Return to bug 119820
Collapse All | Expand All

(-)./files/patch-src_vmmouse.c (+28 lines)
Line 0 Link Here
1
--- src/vmmouse.c.orig	Wed Sep 26 08:11:47 2007
2
+++ src/vmmouse.c	Sun Jan 20 17:10:54 2008
3
@@ -964,8 +964,11 @@
4
    VMMOUSE_INPUT_DATA  vmmouseInput;
5
    int ps2Buttons = 0;
6
    int numPackets;
7
+   VMMousePrivPtr mPriv;
8
+   double factorX, factorY;
9
 
10
    pMse = pInfo->private;  
11
+   mPriv = pMse->mousePriv;
12
    while((numPackets = VMMouseClient_GetInput(&vmmouseInput))){
13
       if (numPackets == VMMOUSE_ERROR) {
14
          VMMouseClient_Disable();
15
@@ -990,6 +993,13 @@
16
       dy = vmmouseInput.Y; 
17
       dz = (char)vmmouseInput.Z;
18
       dw = 0;
19
+
20
+      /* X server 1.4.0 does not call VMMouseConvertProc() so we scale coordinates here */
21
+      factorX = ((double) screenInfo.screens[mPriv->screenNum]->width) / (double) 65535;
22
+      factorY = ((double) screenInfo.screens[mPriv->screenNum]->height) / (double) 65535;
23
+      dx = dx * factorX + 0.5;
24
+      dy = dy * factorY + 0.5;
25
+
26
       /* post an event */
27
       pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
28
    }

Return to bug 119820