summaryrefslogtreecommitdiffstats
path: root/x11-drivers/xf86-input-mouse
diff options
context:
space:
mode:
Diffstat (limited to 'x11-drivers/xf86-input-mouse')
-rw-r--r--x11-drivers/xf86-input-mouse/Makefile2
-rw-r--r--x11-drivers/xf86-input-mouse/distinfo4
-rw-r--r--x11-drivers/xf86-input-mouse/files/patch-src-bsd_mouse.c271
-rw-r--r--x11-drivers/xf86-input-mouse/files/patch-src_mouse.c198
-rw-r--r--x11-drivers/xf86-input-mouse/files/patch-src_mouse.h37
-rw-r--r--x11-drivers/xf86-input-mouse/files/patch-src_mousePriv.h14
6 files changed, 261 insertions, 265 deletions
diff --git a/x11-drivers/xf86-input-mouse/Makefile b/x11-drivers/xf86-input-mouse/Makefile
index a431fce..879fec7 100644
--- a/x11-drivers/xf86-input-mouse/Makefile
+++ b/x11-drivers/xf86-input-mouse/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= xf86-input-mouse
-PORTVERSION= 1.7.2
+PORTVERSION= 1.8.0
CATEGORIES= x11-drivers
MAINTAINER= x11@FreeBSD.org
diff --git a/x11-drivers/xf86-input-mouse/distinfo b/x11-drivers/xf86-input-mouse/distinfo
index 5417e26..1d2966b 100644
--- a/x11-drivers/xf86-input-mouse/distinfo
+++ b/x11-drivers/xf86-input-mouse/distinfo
@@ -1,2 +1,2 @@
-SHA256 (xorg/driver/xf86-input-mouse-1.7.2.tar.bz2) = 332b7357c18e6b9daba51c8ed48ce118e9b51fb5990b6a2a68637be62da7413b
-SIZE (xorg/driver/xf86-input-mouse-1.7.2.tar.bz2) = 341378
+SHA256 (xorg/driver/xf86-input-mouse-1.8.0.tar.bz2) = 075fdc392e69b7aefae9f032785bb28e74fa45e865d2cfd67cdd6482580e3fdf
+SIZE (xorg/driver/xf86-input-mouse-1.8.0.tar.bz2) = 356951
diff --git a/x11-drivers/xf86-input-mouse/files/patch-src-bsd_mouse.c b/x11-drivers/xf86-input-mouse/files/patch-src-bsd_mouse.c
index b1da04c..078d52a 100644
--- a/x11-drivers/xf86-input-mouse/files/patch-src-bsd_mouse.c
+++ b/x11-drivers/xf86-input-mouse/files/patch-src-bsd_mouse.c
@@ -1,64 +1,57 @@
---- src/bsd_mouse.c.orig 2008-11-26 23:11:36.000000000 -0500
-+++ src/bsd_mouse.c 2009-04-07 17:10:17.000000000 -0400
-@@ -1,4 +1,3 @@
--
- /*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
-@@ -71,15 +70,20 @@
+--- src/bsd_mouse.c.orig 2012-07-27 08:10:56.000000000 +0200
++++ src/bsd_mouse.c 2012-07-30 00:49:09.000000000 +0200
+@@ -71,15 +71,20 @@
static const char *FindDevice(InputInfoPtr, const char *, int);
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-+#if !defined(XPS2_SUPPORT) && (__FreeBSD_kernel_version >= 700106)
++#if !defined(XPS2_SUPPORT)
+#define XPS2_SUPPORT
+#endif
/* These are for FreeBSD and DragonFly */
- #define DEFAULT_MOUSE_DEV "/dev/mouse"
- #define DEFAULT_SYSMOUSE_DEV "/dev/sysmouse"
- #define DEFAULT_PS2_DEV "/dev/psm0"
-+#define DEFAULT_USB_DEV "/dev/ums0"
+ #define DEFAULT_MOUSE_DEV "/dev/mouse"
+ #define DEFAULT_SYSMOUSE_DEV "/dev/sysmouse"
+ #define DEFAULT_PS2_DEV "/dev/psm0"
++#define DEFAULT_USB_DEV "/dev/ums0"
static const char *mouseDevs[] = {
- DEFAULT_MOUSE_DEV,
- DEFAULT_SYSMOUSE_DEV,
- DEFAULT_PS2_DEV,
-+ DEFAULT_USB_DEV,
- NULL
+ DEFAULT_MOUSE_DEV,
+ DEFAULT_SYSMOUSE_DEV,
+ DEFAULT_PS2_DEV,
++ DEFAULT_USB_DEV,
+ NULL
};
#elif (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
-@@ -100,7 +104,11 @@
+@@ -100,7 +105,11 @@
#if defined(__NetBSD__)
return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO;
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
- return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_MISC;
+ return MSE_SERIAL | MSE_BUS | MSE_PS2 |
+#ifdef XPS2_SUPPORT
-+ MSE_XPS2 |
++ MSE_XPS2 |
+#endif
-+ MSE_AUTO | MSE_MISC;
++ MSE_AUTO | MSE_MISC;
#else
- return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO;
+ return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO | MSE_MISC;
#endif
-@@ -179,10 +187,31 @@
- { MOUSE_PROTO_THINK, "ThinkingMouse" },
- { MOUSE_PROTO_SYSMOUSE, "SysMouse" }
+@@ -180,9 +189,30 @@
+ { MOUSE_PROTO_SYSMOUSE, "SysMouse" }
};
--
-+
+
+#ifdef XPS2_SUPPORT
+static struct {
-+ int dmodel;
-+ char *name;
++ int dmodel;
++ char *name;
+} ps2proto[] = {
-+ { MOUSE_MODEL_NETSCROLL, "NetScrollPS/2" },
-+ { MOUSE_MODEL_NET, "NetMousePS/2" },
-+ { MOUSE_MODEL_GLIDEPOINT, "GlidePointPS/2" },
-+ { MOUSE_MODEL_THINK, "ThinkingMousePS/2" },
-+ { MOUSE_MODEL_INTELLI, "IMPS/2" },
-+ { MOUSE_MODEL_MOUSEMANPLUS, "MouseManPlusPS/2" },
-+ { MOUSE_MODEL_EXPLORER, "ExplorerPS/2" },
-+ { MOUSE_MODEL_4D, "IMPS/2" },
-+ { MOUSE_MODEL_4DPLUS, "IMPS/2" },
++ { MOUSE_MODEL_NETSCROLL, "NetScrollPS/2" },
++ { MOUSE_MODEL_NET, "NetMousePS/2" },
++ { MOUSE_MODEL_GLIDEPOINT, "GlidePointPS/2" },
++ { MOUSE_MODEL_THINK, "ThinkingMousePS/2" },
++ { MOUSE_MODEL_INTELLI, "IMPS/2" },
++ { MOUSE_MODEL_MOUSEMANPLUS, "MouseManPlusPS/2" },
++ { MOUSE_MODEL_EXPLORER, "ExplorerPS/2" },
++ { MOUSE_MODEL_4D, "IMPS/2" },
++ { MOUSE_MODEL_4DPLUS, "IMPS/2" },
+};
+#endif
+
@@ -72,56 +65,52 @@
int i;
mousehw_t hw;
mousemode_t mode;
-@@ -190,10 +219,16 @@
+@@ -190,7 +220,13 @@
if (pInfo->fd == -1)
- return NULL;
+ return NULL;
+#ifdef XPS2_SUPPORT
/* set the driver operation level, if applicable */
+ dev = xf86FindOptionValue(pInfo->options, "Device");
+ if (dev != NULL && !strncmp(dev, DEFAULT_PS2_DEV, 8))
-+ i = 2;
++ i = 2;
+ else
+#endif
i = 1;
ioctl(pInfo->fd, MOUSE_SETLEVEL, &i);
--
-+
- /* interrogate the driver and get some intelligence on the device. */
- hw.iftype = MOUSE_IF_UNKNOWN;
- hw.model = MOUSE_MODEL_GENERIC;
-@@ -209,9 +244,18 @@
- protoPara[0] = mode.syncmask[0];
- protoPara[1] = mode.syncmask[1];
- }
-+ proto = devproto[i].name;
+
+@@ -209,9 +245,18 @@
+ protoPara[0] = mode.syncmask[0];
+ protoPara[1] = mode.syncmask[1];
+ }
++ proto = devproto[i].name;
+#ifdef XPS2_SUPPORT
-+ if (mode.protocol == MOUSE_PROTO_PS2)
-+ for (i = 0; i < sizeof(ps2proto)/sizeof(ps2proto[0]); ++i)
-+ if (hw.model == ps2proto[i].dmodel) {
-+ proto = ps2proto[i].name;
-+ break;
-+ }
++ if (mode.protocol == MOUSE_PROTO_PS2)
++ for (i = 0; i < sizeof(ps2proto)/sizeof(ps2proto[0]); ++i)
++ if (hw.model == ps2proto[i].dmodel) {
++ proto = ps2proto[i].name;
++ break;
++ }
+#endif
- xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s\n",
-- pInfo->name, devproto[i].name);
-- return devproto[i].name;
-+ pInfo->name, proto);
-+ return proto;
- }
- }
+ xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s\n",
+- pInfo->name, devproto[i].name);
+- return devproto[i].name;
++ pInfo->name, proto);
++ return proto;
+ }
+ }
}
-@@ -234,41 +278,41 @@
- (protocol && xf86NameCmp(protocol, "SysMouse") == 0)) {
- /*
- * As the FreeBSD sysmouse driver defaults to protocol level 0
-- * everytime it is opened we enforce protocol level 1 again at
-+ * everytime it is closed we enforce protocol level 1 again at
- * this point.
- */
- mode.level = 1;
+@@ -234,41 +279,41 @@
+ (protocol && xf86NameCmp(protocol, "SysMouse") == 0)) {
+ /*
+ * As the FreeBSD sysmouse driver defaults to protocol level 0
+- * everytime it is opened we enforce protocol level 1 again at
++ * everytime it is closed we enforce protocol level 1 again at
+ * this point.
+ */
+ mode.level = 1;
} else
-- mode.level = -1;
+- mode.level = -1;
-#else
- mode.level = -1;
#endif
@@ -151,26 +140,26 @@
+ unsigned int i;
- if ((f = fopen(MOUSED_PID_FILE, "r")) != NULL) {
-- if (fscanf(f, "%u", &pid) == 1 && pid > 0) {
-- if (kill(pid, 0) == 0) {
-- fclose(f);
-- return TRUE;
-- }
+- if (fscanf(f, "%u", &pid) == 1 && pid > 0) {
+- if (kill(pid, 0) == 0) {
+- fclose(f);
+- return TRUE;
+- }
+ if (dev)
-+ sprintf(cmd, "sh -c 'fstat %s | grep -c moused' 2>/dev/null", dev);
++ sprintf(cmd, "sh -c 'fstat %s | grep -c moused' 2>/dev/null", dev);
+ else
-+ sprintf(cmd, "sh -c 'pgrep -nx moused' 2>/dev/null");
++ sprintf(cmd, "sh -c 'pgrep -nx moused' 2>/dev/null");
+ if ((f = popen(cmd, "r")) != NULL) {
-+ if (fscanf(f, "%u", &i) == 1 && i > 0) {
-+ pclose(f);
-+ return TRUE;
- }
-- fclose(f);
-+ pclose(f);
++ if (fscanf(f, "%u", &i) == 1 && i > 0) {
++ pclose(f);
++ return TRUE;
+ }
+- fclose(f);
++ pclose(f);
}
return FALSE;
}
-@@ -276,17 +320,17 @@
+@@ -276,17 +321,17 @@
static const char *
FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
{
@@ -182,63 +171,63 @@
struct stat sb;
for (pdev = mouseDevs; *pdev; pdev++) {
-- SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK));
-- if (fd == -1) {
-+ SYSCALL (ret = stat(*pdev, &sb));
-+ if (ret == -1) {
+- SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK));
+- if (fd == -1) {
++ SYSCALL (ret = stat(*pdev, &sb));
++ if (ret == -1) {
#ifdef DEBUG
-- ErrorF("Cannot open %s (%s)\n", *pdev, strerror(errno));
-+ ErrorF("Cannot stat %s (%s)\n", *pdev, strerror(errno));
+- ErrorF("Cannot open %s (%s)\n", *pdev, strerror(errno));
++ ErrorF("Cannot stat %s (%s)\n", *pdev, strerror(errno));
#endif
- } else {
- /*
-@@ -295,28 +339,32 @@
- * the test for whether /dev/sysmouse is usable can be made.
- */
- if (!strcmp(*pdev, DEFAULT_MOUSE_DEV)) {
-- if (fstat(fd, &devMouseStat) == 0)
-- devMouse = TRUE;
-- close(fd);
-+ memcpy(&devMouseStat, &sb, sizeof(devMouseStat));
-+ devMouse = TRUE;
- continue;
- } else if (!strcmp(*pdev, DEFAULT_SYSMOUSE_DEV)) {
- /* Check if /dev/mouse is the same as /dev/sysmouse. */
-- if (devMouse && fstat(fd, &sb) == 0 &&
-- devMouseStat.st_dev == sb.st_dev &&
-+ if (devMouse && devMouseStat.st_dev == sb.st_dev &&
- devMouseStat.st_ino == sb.st_ino) {
- /* If the same, use /dev/sysmouse. */
- devMouse = FALSE;
- }
-- close(fd);
-- if (MousedRunning())
-+ if (MousedRunning(NULL))
- break;
-- else {
+ } else {
+ /*
+@@ -295,28 +340,32 @@
+ * the test for whether /dev/sysmouse is usable can be made.
+ */
+ if (!strcmp(*pdev, DEFAULT_MOUSE_DEV)) {
+- if (fstat(fd, &devMouseStat) == 0)
+- devMouse = TRUE;
+- close(fd);
++ memcpy(&devMouseStat, &sb, sizeof(devMouseStat));
++ devMouse = TRUE;
+ continue;
+ } else if (!strcmp(*pdev, DEFAULT_SYSMOUSE_DEV)) {
+ /* Check if /dev/mouse is the same as /dev/sysmouse. */
+- if (devMouse && fstat(fd, &sb) == 0 &&
+- devMouseStat.st_dev == sb.st_dev &&
++ if (devMouse && devMouseStat.st_dev == sb.st_dev &&
+ devMouseStat.st_ino == sb.st_ino) {
+ /* If the same, use /dev/sysmouse. */
+ devMouse = FALSE;
+ }
+- close(fd);
+- if (MousedRunning())
++ if (MousedRunning(NULL))
+ break;
+- else {
-#ifdef DEBUG
-- ErrorF("moused isn't running\n");
+- ErrorF("moused isn't running\n");
-#endif
-- }
- } else {
-- close(fd);
-+ /* Check if /dev/mouse is the same as this device. */
-+ if (devMouse && devMouseStat.st_dev == sb.st_dev &&
-+ devMouseStat.st_ino == sb.st_ino) {
-+ /* If the same, use this device. */
-+ devMouse = FALSE;
-+ }
-+ if (MousedRunning(*pdev))
-+ continue;
-+ /* ums(4) does not support anything but SysMouse protocol. */
-+ if (!strncmp(*pdev, DEFAULT_USB_DEV, 8) && protocol &&
-+ xf86NameCmp(protocol, "auto") != 0 &&
-+ xf86NameCmp(protocol, "sysmouse") != 0)
-+ continue;
- break;
- }
- }
-@@ -782,7 +830,9 @@
+- }
+ } else {
+- close(fd);
++ /* Check if /dev/mouse is the same as this device. */
++ if (devMouse && devMouseStat.st_dev == sb.st_dev &&
++ devMouseStat.st_ino == sb.st_ino) {
++ /* If the same, use this device. */
++ devMouse = FALSE;
++ }
++ if (MousedRunning(*pdev))
++ continue;
++ /* ums(4) does not support anything but SysMouse protocol. */
++ if (!strncmp(*pdev, DEFAULT_USB_DEV, 8) && protocol &&
++ xf86NameCmp(protocol, "auto") != 0 &&
++ xf86NameCmp(protocol, "sysmouse") != 0)
++ continue;
+ break;
+ }
+ }
+@@ -764,7 +813,9 @@
p->CheckProtocol = CheckProtocol;
#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)) && defined(MOUSE_PROTO_SYSMOUSE)
p->SetupAuto = SetupAuto;
diff --git a/x11-drivers/xf86-input-mouse/files/patch-src_mouse.c b/x11-drivers/xf86-input-mouse/files/patch-src_mouse.c
index c32b5b6..2d363d5 100644
--- a/x11-drivers/xf86-input-mouse/files/patch-src_mouse.c
+++ b/x11-drivers/xf86-input-mouse/files/patch-src_mouse.c
@@ -1,56 +1,56 @@
---- ./src/mouse.c.orig 2011-06-25 07:26:47.000000000 +0200
-+++ ./src/mouse.c 2012-03-02 14:02:43.000000000 +0100
-@@ -271,13 +271,39 @@
+--- src/mouse.c.orig 2012-07-27 08:10:56.000000000 +0200
++++ src/mouse.c 2012-07-30 00:31:48.000000000 +0200
+@@ -280,13 +280,39 @@
pMse = pInfo->private;
- pMse->buttons = xf86SetIntOption(pInfo->options, "Buttons", 0);
+ i = xf86SetIntOption(pInfo->options, "Buttons", 0);
+ if (i != 0)
-+ pMse->buttons = i;
++ pMse->buttons = i;
if (!pMse->buttons) {
- pMse->buttons = MSE_DFLTBUTTONS;
- buttons_from = X_DEFAULT;
+ pMse->buttons = MSE_DFLTBUTTONS;
+ buttons_from = X_DEFAULT;
}
origButtons = pMse->buttons;
+ s = xf86SetStrOption(pInfo->options, "ButtonMapping", NULL);
+ if (s) {
-+ int b, n = 0;
-+ char *s1 = s;
-+ /* keep getting numbers which are buttons */
-+ while (s1 && n < MSE_MAXBUTTONS && (b = strtol(s1, &s1, 10)) != 0) {
-+ /* check sanity for a button */
-+ if (b < 0 || b > MSE_MAXBUTTONS) {
-+ xf86Msg(X_WARNING,
-+ "ButtonMapping: Invalid button number = %d\n", b);
-+ break;
-+ };
-+ pMse->buttonMap[n++] = 1 << (b-1);
-+ if (b > pMse->buttons) pMse->buttons = b;
-+ }
-+ free(s);
++ int b, n = 0;
++ char *s1 = s;
++ /* keep getting numbers which are buttons */
++ while (s1 && n < MSE_MAXBUTTONS && (b = strtol(s1, &s1, 10)) != 0) {
++ /* check sanity for a button */
++ if (b < 0 || b > MSE_MAXBUTTONS) {
++ xf86Msg(X_WARNING,
++ "ButtonMapping: Invalid button number = %d\n", b);
++ break;
++ };
++ pMse->buttonMap[n++] = 1 << (b-1);
++ if (b > pMse->buttons) pMse->buttons = b;
++ }
++ free(s);
+ }
+ /* get maximum of mapped buttons */
+ for (i = pMse->buttons-1; i >= 0; i--) {
-+ int f = ffs (pMse->buttonMap[i]);
-+ if (f > pMse->buttons)
-+ pMse->buttons = f;
++ int f = ffs (pMse->buttonMap[i]);
++ if (f > pMse->buttons)
++ pMse->buttons = f;
+ }
+
pMse->emulate3Buttons = xf86SetBoolOption(pInfo->options,
- "Emulate3Buttons", FALSE);
+ "Emulate3Buttons", FALSE);
if (!xf86FindOptionValue(pInfo->options,"Emulate3Buttons")) {
-@@ -289,6 +315,8 @@
- "Emulate3Timeout", 50);
+@@ -298,6 +324,8 @@
+ "Emulate3Timeout", 50);
if (pMse->emulate3Buttons || pMse->emulate3ButtonsSoft) {
- MessageType from = X_CONFIG;
+ MessageType from = X_CONFIG;
+ if (pMse->buttons < 3)
-+ pMse->buttons = 3;
- if (pMse->emulate3ButtonsSoft)
- from = X_DEFAULT;
- xf86Msg(from, "%s: Emulate3Buttons, Emulate3Timeout: %d\n",
-@@ -296,6 +324,8 @@
++ pMse->buttons = 3;
+ if (pMse->emulate3ButtonsSoft)
+ from = X_DEFAULT;
+ xf86Msg(from, "%s: Emulate3Buttons, Emulate3Timeout: %d\n",
+@@ -305,6 +333,8 @@
}
pMse->chordMiddle = xf86SetBoolOption(pInfo->options, "ChordMiddle", FALSE);
@@ -58,39 +58,39 @@
+ pMse->buttons = 3;
pMse->flipXY = xf86SetBoolOption(pInfo->options, "FlipXY", FALSE);
if (xf86SetBoolOption(pInfo->options, "InvX", FALSE)) {
- pMse->invX = -1;
-@@ -306,7 +336,7 @@
+ pMse->invX = -1;
+@@ -315,7 +345,7 @@
} else
- pMse->invY = 1;
+ pMse->invY = 1;
pMse->angleOffset = xf86SetIntOption(pInfo->options, "AngleOffset", 0);
--
+-
+ pMse->sensitivity = xf86SetRealOption(pInfo->options, "Sensitivity", 1.0);
if (pMse->pDragLock)
- free(pMse->pDragLock);
-@@ -416,14 +446,17 @@
- free(s);
+ free(pMse->pDragLock);
+@@ -425,14 +455,17 @@
+ free(s);
}
- s = xf86SetStrOption(pInfo->options, "ZAxisMapping", "4 5");
+ s = xf86SetStrOption(pInfo->options, "ZAxisMapping",
-+ pMse->hasZ ? ( pMse->hasW ? "4 5 6 7" : "4 5" ) : "off");
++ pMse->hasZ ? ( pMse->hasW ? "4 5 6 7" : "4 5" ) : "off");
if (s) {
- int b1 = 0, b2 = 0, b3 = 0, b4 = 0;
- char *msg = NULL;
-
- pMse->negativeZ = pMse->positiveZ = MSE_NOAXISMAP;
- pMse->negativeW = pMse->positiveW = MSE_NOAXISMAP;
-- if (!xf86NameCmp(s, "x")) {
-+ if (!xf86NameCmp(s, "off")) {
-+ msg = xstrdup("off");
+ int b1 = 0, b2 = 0, b3 = 0, b4 = 0;
+ char *msg = NULL;
+
+ pMse->negativeZ = pMse->positiveZ = MSE_NOAXISMAP;
+ pMse->negativeW = pMse->positiveW = MSE_NOAXISMAP;
+- if (!xf86NameCmp(s, "x")) {
++ if (!xf86NameCmp(s, "off")) {
++ msg = xstrdup("off");
+ } else if (!xf86NameCmp(s, "x")) {
- pMse->negativeZ = pMse->positiveZ = MSE_MAPTOX;
- msg = xstrdup("X axis");
- } else if (!xf86NameCmp(s, "y")) {
-@@ -559,29 +592,6 @@
- pInfo->name, wheelButton, pMse->wheelInertia,
- pMse->wheelButtonTimeout);
+ pMse->negativeZ = pMse->positiveZ = MSE_MAPTOX;
+ msg = xstrdup("X axis");
+ } else if (!xf86NameCmp(s, "y")) {
+@@ -568,29 +601,6 @@
+ pInfo->name, wheelButton, pMse->wheelInertia,
+ pMse->wheelButtonTimeout);
}
- s = xf86SetStrOption(pInfo->options, "ButtonMapping", NULL);
- if (s) {
@@ -98,27 +98,27 @@
- char *s1 = s;
- /* keep getting numbers which are buttons */
- while (s1 && n < MSE_MAXBUTTONS && (b = strtol(s1, &s1, 10)) != 0) {
-- /* check sanity for a button */
-- if (b < 0 || b > MSE_MAXBUTTONS) {
-- xf86Msg(X_WARNING,
-- "ButtonMapping: Invalid button number = %d\n", b);
-- break;
-- };
-- pMse->buttonMap[n++] = 1 << (b-1);
-- if (b > pMse->buttons) pMse->buttons = b;
+- /* check sanity for a button */
+- if (b < 0 || b > MSE_MAXBUTTONS) {
+- xf86Msg(X_WARNING,
+- "ButtonMapping: Invalid button number = %d\n", b);
+- break;
+- };
+- pMse->buttonMap[n++] = 1 << (b-1);
+- if (b > pMse->buttons) pMse->buttons = b;
- }
- free(s);
- }
- /* get maximum of mapped buttons */
- for (i = pMse->buttons-1; i >= 0; i--) {
-- int f = ffs (pMse->buttonMap[i]);
-- if (f > pMse->buttons)
-- pMse->buttons = f;
+- int f = ffs (pMse->buttonMap[i]);
+- if (f > pMse->buttons)
+- pMse->buttons = f;
- }
if (origButtons != pMse->buttons)
- buttons_from = X_CONFIG;
+ buttons_from = X_CONFIG;
xf86Msg(buttons_from, "%s: Buttons: %d\n", pInfo->name, pMse->buttons);
-@@ -659,7 +669,6 @@
+@@ -668,7 +678,6 @@
}
pMse->sampleRate = xf86SetIntOption(pInfo->options, "SampleRate", 0);
pMse->resolution = xf86SetIntOption(pInfo->options, "Resolution", 0);
@@ -126,51 +126,57 @@
}
static void
-@@ -948,6 +957,8 @@
+@@ -959,6 +968,8 @@
/* Default Mapping: 1 2 3 8 9 10 11 ... */
for (i = 0; i < MSE_MAXBUTTONS; i++)
- pMse->buttonMap[i] = 1 << (i > 2 && i < MSE_MAXBUTTONS-4 ? i+4 : i);
+ pMse->buttonMap[i] = 1 << (i > 2 && i < MSE_MAXBUTTONS-4 ? i+4 : i);
+ pMse->hasZ = 1;
+ pMse->hasW = 0;
protocol = MousePickProtocol(pInfo, device, protocol, &protocolID);
-@@ -2085,6 +2096,9 @@
- }
- }
- }
-+ } else {
-+ pMse->wheelXDistance = 0;
-+ pMse->wheelYDistance = 0;
- }
-
- /* Absorb the mouse movement while the wheel button is pressed. */
-@@ -2102,7 +2116,7 @@
+@@ -2137,7 +2148,7 @@
+
+ if (pMse->emulateWheel) {
+ /* Emulate wheel button handling */
+- if(pMse->wheelButton == 0)
++ if (pMse->wheelButton == 0)
+ wheelButtonMask = 0;
+ else
+ wheelButtonMask = 1 << (pMse->wheelButton - 1);
+@@ -2221,6 +2232,9 @@
+ }
+ }
+ }
++ } else {
++ pMse->wheelXDistance = 0;
++ pMse->wheelYDistance = 0;
+ }
+
+ /* Absorb the mouse movement while the wheel button is pressed. */
+@@ -2238,7 +2252,7 @@
if (pMse->emulate3ButtonsSoft && pMse->emulate3Pending && (dx || dy))
- buttonTimer(pInfo);
+ buttonTimer(pInfo);
- if (dx || dy)
+ if ((dx || dy) && !pMse->disableXY)
- xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy);
+ xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy);
if (change) {
-@@ -2312,13 +2326,13 @@
+@@ -2448,11 +2462,11 @@
- /* Accumulate the scaled dx, dy in the private variables
+ /* Accumulate the scaled dx, dy in the private variables
fracdx,fracdy and return the integer number part */
- if (mousepriv) {
-- mousepriv->fracdx += mousepriv->sensitivity*dx;
-- mousepriv->fracdy += mousepriv->sensitivity*dy;
-- mousepriv->fracdx -= ( dx=(int)(mousepriv->fracdx) );
-- mousepriv->fracdy -= ( dy=(int)(mousepriv->fracdy) );
+- mousepriv->fracdx += mousepriv->sensitivity*dx;
+- mousepriv->fracdy += mousepriv->sensitivity*dy;
+- mousepriv->fracdx -= ( dx=(int)(mousepriv->fracdx) );
+- mousepriv->fracdy -= ( dy=(int)(mousepriv->fracdy) );
+ if (pMse->sensitivity != 0) {
-+ pMse->fracdx += pMse->sensitivity*dx;
-+ pMse->fracdy += pMse->sensitivity*dy;
-+ pMse->fracdx -= ( dx=(int)(pMse->fracdx) );
-+ pMse->fracdy -= ( dy=(int)(pMse->fracdy) );
++ pMse->fracdx += pMse->sensitivity*dx;
++ pMse->fracdy += pMse->sensitivity*dy;
++ pMse->fracdx -= ( dx=(int)(pMse->fracdx) );
++ pMse->fracdy -= ( dy=(int)(pMse->fracdy) );
}
--
-+
+
/* If mouse wheel movement has to be mapped on a button, we need to
- * loop for button press and release events. */
- do {
diff --git a/x11-drivers/xf86-input-mouse/files/patch-src_mouse.h b/x11-drivers/xf86-input-mouse/files/patch-src_mouse.h
index 98defb1..abb2ac9 100644
--- a/x11-drivers/xf86-input-mouse/files/patch-src_mouse.h
+++ b/x11-drivers/xf86-input-mouse/files/patch-src_mouse.h
@@ -1,24 +1,25 @@
---- ./src/mouse.h.orig 2011-06-25 07:24:41.000000000 +0200
-+++ ./src/mouse.h 2012-03-02 14:02:43.000000000 +0100
-@@ -217,10 +217,12 @@
- Bool emulate3ButtonsSoft;
- int emulate3Timeout;/* Timeout for 3 button emulation */
- Bool chordMiddle;
-+ Bool disableXY;
+--- src/mouse.h.orig 2012-07-27 08:10:56.000000000 +0200
++++ src/mouse.h 2012-07-30 00:41:02.000000000 +0200
+@@ -217,10 +217,13 @@
+ Bool emulate3ButtonsSoft;
+ int emulate3Timeout;/* Timeout for 3 button emulation */
+ Bool chordMiddle;
++ Bool disableXY;
Bool flipXY;
int invX;
int invY;
- int resolution;
-+ Bool hasZ, hasW;
- int negativeZ; /* button mask */
- int positiveZ; /* button mask */
- int negativeW; /* button mask */
-@@ -259,6 +261,8 @@
- int doubleClickOldSourceState;
- int lastMappedButtons;
- int buttonMap[MSE_MAXBUTTONS];
-+ float fracdx,fracdy;
-+ float sensitivity;
+ int resolution;
++ Bool hasW;
++ Bool hasZ;
+ int negativeZ; /* button mask */
+ int positiveZ; /* button mask */
+ int negativeW; /* button mask */
+@@ -259,6 +262,8 @@
+ int doubleClickOldSourceState;
+ int lastMappedButtons;
+ int buttonMap[MSE_MAXBUTTONS];
++ float fracdx,fracdy;
++ float sensitivity;
} MouseDevRec, *MouseDevPtr;
#endif /* _XF86OSMOUSE_H_ */
diff --git a/x11-drivers/xf86-input-mouse/files/patch-src_mousePriv.h b/x11-drivers/xf86-input-mouse/files/patch-src_mousePriv.h
index 2661ab7..8abb8c3 100644
--- a/x11-drivers/xf86-input-mouse/files/patch-src_mousePriv.h
+++ b/x11-drivers/xf86-input-mouse/files/patch-src_mousePriv.h
@@ -1,11 +1,11 @@
---- ./src/mousePriv.h.orig 2009-10-16 23:40:45.000000000 +0200
-+++ ./src/mousePriv.h 2012-03-02 14:02:43.000000000 +0100
+--- src/mousePriv.h.orig 2012-07-27 08:10:56.000000000 +0200
++++ src/mousePriv.h 2012-07-30 00:39:00.000000000 +0200
@@ -63,8 +63,6 @@
- int acc;
- CARD32 pnpLast;
- Bool disablePnPauto;
-- float fracdx,fracdy;
-- float sensitivity;
+ int acc;
+ CARD32 pnpLast;
+ Bool disablePnPauto;
+- float fracdx,fracdy;
+- float sensitivity;
} mousePrivRec, *mousePrivPtr;
/* mouse proto flags */