You are not logged in.

#1 2008-10-23 16:55:49

lloeki
Member
From: France
Registered: 2007-02-20
Posts: 456
Website

xf86-input-vmmouse reports unscaled coordinates, makes it unusable

Does not qualify as a bug per guidelines, but worthy to know.

Description:

When running ArchLinux inside VMWare (here Fusion, but true for others), with xorg-server 1.4 and xf86-input-vmmouse driver, the mouse doesn't behave correctly. The cause is xorg-server dropping some scaling function from somewhere and not making it back in another more appropraite place. This impacts vmmouse as it scales the real screen coordinates to emulated ones.
A workaround is to use xf86-input-mouse driver in lieu of vmmouse, but it drops seamless mouse support, thus unbearable.
Another workaround is to patch vmmouse to do the scaling. This is my current solution and works really good.
The real fix belongs to xorg-server and is fixed up there in master. I guess it should not make it before xorg-server 1.5.

Discussion and workaround patch:
http://www.mailinglistarchive.com/freeb … 33026.html

Upstream bug and fix:
http://bugs.freedesktop.org/show_bug.cgi?id=10324

Additional info:
* package version(s)
xorg-server 1.4.2-2
xf86-input-vmmouse 12.4.3-1

For reference, add this to PKGBUILD after the 'cd' line:

patch -Np1 -i ../../xorg-server-1.4.diff

and here's patch file contents:

--- orig/xf86-input-vmmouse-12.4.3/src/vmmouse.c        2007-09-25 16:11:47.000000000 -0700
+++ xf86-input-vmmouse-12.4.3/src/vmmouse.c     2008-01-08 14:58:59.000000000 -0800
@@ -964,8 +964,11 @@
    VMMOUSE_INPUT_DATA  vmmouseInput;
    int ps2Buttons = 0;
    int numPackets;
+   VMMousePrivPtr mPriv;
+   double factorX, factorY;
 
    pMse = pInfo->private;  
+   mPriv = pMse->mousePriv;
    while((numPackets = VMMouseClient_GetInput(&vmmouseInput))){
       if (numPackets == VMMOUSE_ERROR) {
          VMMouseClient_Disable();
@@ -990,6 +993,13 @@
       dy = vmmouseInput.Y; 
       dz = (char)vmmouseInput.Z;
       dw = 0;
+
+      /* X server 1.4.0 does not call VMMouseConvertProc() so we scale coordinates here */
+      factorX = ((double) screenInfo.screens[mPriv->screenNum]->width) / (double) 65535;
+      factorY = ((double) screenInfo.screens[mPriv->screenNum]->height) / (double) 65535;
+      dx = dx * factorX + 0.5;
+      dy = dy * factorY + 0.5;
+
       /* post an event */
       pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
    }

Last edited by lloeki (2008-10-23 16:56:03)


To know recursion, you must first know recursion.

Offline

#2 2008-10-23 17:03:02

lloeki
Member
From: France
Registered: 2007-02-20
Posts: 456
Website

Re: xf86-input-vmmouse reports unscaled coordinates, makes it unusable

BTW according to upstream discussion it might affect other (non-virtual) devices needing scaling, like wacom tablets.


To know recursion, you must first know recursion.

Offline

Board footer

Powered by FluxBB