From 81c87568a53314cf9e78c95e1aa34f18799d44fc Mon Sep 17 00:00:00 2001 From: Florent Thoumie Date: Thu, 13 Mar 2008 12:06:45 +0000 Subject: [PATCH] Add patch to fix mouse pointer coordinates. PR: ports/119820 Submitted by: Hiroto Kagotani --- x11-drivers/xf86-input-vmmouse/Makefile | 1 + .../files/patch-src_vmmouse.c | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 x11-drivers/xf86-input-vmmouse/files/patch-src_vmmouse.c diff --git a/x11-drivers/xf86-input-vmmouse/Makefile b/x11-drivers/xf86-input-vmmouse/Makefile index 117032301b6f..c870b92a9426 100644 --- a/x11-drivers/xf86-input-vmmouse/Makefile +++ b/x11-drivers/xf86-input-vmmouse/Makefile @@ -7,6 +7,7 @@ PORTNAME= xf86-input-vmmouse PORTVERSION= 12.4.3 +PORTREVISION= 1 CATEGORIES= x11-drivers MAINTAINER= x11@FreeBSD.org diff --git a/x11-drivers/xf86-input-vmmouse/files/patch-src_vmmouse.c b/x11-drivers/xf86-input-vmmouse/files/patch-src_vmmouse.c new file mode 100644 index 000000000000..94d61e4e9c0d --- /dev/null +++ b/x11-drivers/xf86-input-vmmouse/files/patch-src_vmmouse.c @@ -0,0 +1,28 @@ +--- src/vmmouse.c.orig Wed Sep 26 08:11:47 2007 ++++ src/vmmouse.c Sun Jan 20 17:10:54 2008 +@@ -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); + }