summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver/xf86-input-mouse/configure20
-rw-r--r--driver/xf86-input-mouse/src/mouse.c49
2 files changed, 53 insertions, 16 deletions
diff --git a/driver/xf86-input-mouse/configure b/driver/xf86-input-mouse/configure
index 04ad5153b..306ec0fe4 100644
--- a/driver/xf86-input-mouse/configure
+++ b/driver/xf86-input-mouse/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for xf86-input-mouse 1.1.2.
+# Generated by GNU Autoconf 2.59 for xf86-input-mouse 1.2.3.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
#
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='xf86-input-mouse'
PACKAGE_TARNAME='xf86-input-mouse'
-PACKAGE_VERSION='1.1.2'
-PACKAGE_STRING='xf86-input-mouse 1.1.2'
+PACKAGE_VERSION='1.2.3'
+PACKAGE_STRING='xf86-input-mouse 1.2.3'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
ac_unique_file="Makefile.am"
@@ -966,7 +966,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures xf86-input-mouse 1.1.2 to adapt to many kinds of systems.
+\`configure' configures xf86-input-mouse 1.2.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1032,7 +1032,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xf86-input-mouse 1.1.2:";;
+ short | recursive ) echo "Configuration of xf86-input-mouse 1.2.3:";;
esac
cat <<\_ACEOF
@@ -1181,7 +1181,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-xf86-input-mouse configure 1.1.2
+xf86-input-mouse configure 1.2.3
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1195,7 +1195,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by xf86-input-mouse $as_me 1.1.2, which was
+It was created by xf86-input-mouse $as_me 1.2.3, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1840,7 +1840,7 @@ fi
# Define the identity of the package.
PACKAGE='xf86-input-mouse'
- VERSION='1.1.2'
+ VERSION='1.2.3'
cat >>confdefs.h <<_ACEOF
@@ -20658,7 +20658,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by xf86-input-mouse $as_me 1.1.2, which was
+This file was extended by xf86-input-mouse $as_me 1.2.3, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20721,7 +20721,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-xf86-input-mouse config.status 1.1.2
+xf86-input-mouse config.status 1.2.3
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/driver/xf86-input-mouse/src/mouse.c b/driver/xf86-input-mouse/src/mouse.c
index d9875348b..6499de6cc 100644
--- a/driver/xf86-input-mouse/src/mouse.c
+++ b/driver/xf86-input-mouse/src/mouse.c
@@ -213,7 +213,8 @@ typedef enum {
OPTION_VMIN,
OPTION_DRAGLOCKBUTTONS,
OPTION_DOUBLECLICK_BUTTONS,
- OPTION_BUTTON_MAPPING
+ OPTION_BUTTON_MAPPING,
+ OPTION_SENSITIVITY
} MouseOpts;
#ifdef XFree86LOADER
@@ -257,6 +258,7 @@ static const OptionInfoRec mouseOptions[] = {
{ OPTION_DRAGLOCKBUTTONS, "DragLockButtons",OPTV_STRING, {0}, FALSE },
{ OPTION_DOUBLECLICK_BUTTONS,"DoubleClickButtons", OPTV_STRING, {0}, FALSE },
{ OPTION_BUTTON_MAPPING, "ButtonMapping", OPTV_STRING, {0}, FALSE },
+ { OPTION_SENSITIVITY, "Sensitivity", OPTV_REAL, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
#endif
@@ -802,6 +804,12 @@ MouseHWOptions(InputInfoPtr pInfo)
xf86Msg(X_CONFIG, "%s: Resolution: %d\n", pInfo->name,
pMse->resolution);
}
+
+ if (mPriv->sensitivity
+ = xf86SetRealOption(pInfo->options, "Sensitivity", 1.0)) {
+ xf86Msg(X_CONFIG, "%s: Sensitivity: %g\n", pInfo->name,
+ mPriv->sensitivity);
+ }
}
static void
@@ -986,8 +994,10 @@ MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
pInfo->flags = XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS;
pInfo->device_control = MouseProc;
pInfo->read_input = MouseReadInput;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
pInfo->motion_history_proc = xf86GetMotionEvents;
pInfo->history_size = 0;
+#endif
pInfo->control_proc = NULL;
pInfo->close_proc = NULL;
pInfo->switch_mode = NULL;
@@ -1167,6 +1177,9 @@ MouseReadInput(InputInfoPtr pInfo)
pBufP = pMse->protoBufTail;
pBuf = pMse->protoBuf;
+ if (pInfo->fd == -1)
+ return;
+
/*
* Set blocking to -1 on the first call because we know there is data to
* read. Xisb automatically clears it after one successful read so that
@@ -1725,16 +1738,28 @@ MouseProc(DeviceIntPtr device, int what)
InitPointerDeviceStruct((DevicePtr)device, map,
min(pMse->buttons, MSE_MAXBUTTONS),
- miPointerGetMotionEvents, pMse->Ctrl,
- miPointerGetMotionBufferSize());
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
+ miPointerGetMotionEvents,
+#else
+ GetMotionHistory,
+#endif
+ pMse->Ctrl,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
+ miPointerGetMotionBufferSize()
+#else
+ GetMotionHistorySize(), 2
+#endif
+ );
/* X valuator */
- xf86InitValuatorAxisStruct(device, 0, 0, -1, 1, 0, 1);
+ xf86InitValuatorAxisStruct(device, 0, -1, -1, 1, 0, 1);
xf86InitValuatorDefaults(device, 0);
/* Y valuator */
- xf86InitValuatorAxisStruct(device, 1, 0, -1, 1, 0, 1);
+ xf86InitValuatorAxisStruct(device, 1, -1, -1, 1, 0, 1);
xf86InitValuatorDefaults(device, 1);
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
xf86MotionHistoryAllocate(pInfo);
+#endif
#ifdef EXTMOUSEDEBUG
ErrorF("assigning %p atom=%d name=%s\n", device, pInfo->atom,
@@ -2360,10 +2385,13 @@ MousePostEvent(InputInfoPtr pInfo, int truebuttons,
int dx, int dy, int dz, int dw)
{
MouseDevPtr pMse;
+ mousePrivPtr mousepriv;
int zbutton = 0, wbutton = 0, zbuttoncount = 0, wbuttoncount = 0;
int i, b, buttons = 0;
pMse = pInfo->private;
+ mousepriv = (mousePrivPtr)pMse->mousePriv;
+
if (pMse->protocolID == PROT_MMHIT)
b = reverseBits(hitachMap, truebuttons);
else
@@ -2453,6 +2481,15 @@ MousePostEvent(InputInfoPtr pInfo, int truebuttons,
dy = tmp;
}
+ /* 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) );
+ }
+
/* If mouse wheel movement has to be mapped on a button, we need to
* loop for button press and release events. */
do {
@@ -3788,7 +3825,7 @@ static XF86ModuleVersionInfo xf86MouseVersionRec =
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
- 1, 1, 1,
+ PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
ABI_CLASS_XINPUT,
ABI_XINPUT_VERSION,
MOD_CLASS_XINPUT,