.gitignore | 6 + configure.ac | 19 +---- man/.cvsignore | 2 man/mousedrv.man | 3 src/.cvsignore | 6 - src/mouse.c | 198 +++++++++++++++---------------------------------------- src/mouse.h | 3 src/sun_mouse.c | 104 ++++++++++++++++------------ 8 files changed, 127 insertions(+), 214 deletions(-)
New commits: commit 2b6dc8ccfe85356d309e3191cf5b942c6d4e0cd5 Author: Peter Hutterer <[email protected]> Date: Tue Oct 6 12:09:46 2009 +1000 mouse 1.5.0 Signed-off-by: Peter Hutterer <[email protected]> diff --git a/configure.ac b/configure.ac index ebb736e..11c7cab 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-input-mouse], - 1.4.99.1, + 1.5.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-input-mouse) commit 6bae95035db026b7f3189a21942ce7953a6e3437 Author: Peter Hutterer <[email protected]> Date: Tue Oct 6 12:07:45 2009 +1000 Require macros 1.3 for XORG_DEFAULT_OPTIONS Signed-off-by: Peter Hutterer <[email protected]> diff --git a/configure.ac b/configure.ac index 8610206..ebb736e 100644 --- a/configure.ac +++ b/configure.ac @@ -26,9 +26,9 @@ AC_INIT([xf86-input-mouse], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-input-mouse) -# Require xorg-macros version >= 1.2.0 for XORG_CWARNFLAGS & XORG_CHANGELOG -m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])]) -XORG_MACROS_VERSION(1.2) +# Require xorg-macros version >= 1.3.0 for XORG_DEFAULT_OPTIONS +m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.3 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.3) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_AUX_DIR(.) @@ -45,7 +45,7 @@ AM_CONFIG_HEADER([config.h]) AC_DISABLE_STATIC AC_PROG_LIBTOOL AC_PROG_CC -XORG_CWARNFLAGS +XORG_DEFAULT_OPTIONS AH_TOP([#include "xorg-server.h"]) @@ -89,11 +89,6 @@ AC_SUBST([OS_MOUSE_NAME]) dnl Allow checking code with lint, sparse, etc. XORG_WITH_LINT - -XORG_MANPAGE_SECTIONS -XORG_RELEASE_VERSION -XORG_CHANGELOG - XORG_CHECK_LINUXDOC AC_OUTPUT([Makefile src/Makefile man/Makefile]) commit 622cf1834725c3348cfdc41c12e39b327011c836 Author: Alan Coopersmith <[email protected]> Date: Sat Sep 12 20:18:06 2009 -0700 Fix crashes due to MouseBlockHandler/MouseWakeupHandler with invalid devices Don't install the handlers if devices failed to open/initalize. Remove the handlers when disabling Emulate3Soft mode, since otherwise they'll be left around when device is closed & device structs are freed. Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/src/mouse.c b/src/mouse.c index 23dc726..8347be9 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -1691,6 +1691,11 @@ MouseProc(DeviceIntPtr device, int what) } xf86FlushInput(pInfo->fd); xf86AddEnabledDevice(pInfo); + if (pMse->emulate3Buttons || pMse->emulate3ButtonsSoft) { + RegisterBlockAndWakeupHandlers (MouseBlockHandler, + MouseWakeupHandler, + (pointer) pInfo); + } } } } @@ -1701,11 +1706,6 @@ MouseProc(DeviceIntPtr device, int what) pMse->wheelButtonExpires = GetTimeInMillis (); device->public.on = TRUE; FlushButtons(pMse); - if (pMse->emulate3Buttons || pMse->emulate3ButtonsSoft) - { - RegisterBlockAndWakeupHandlers (MouseBlockHandler, MouseWakeupHandler, - (pointer) pInfo); - } break; case DEVICE_OFF: @@ -1720,7 +1720,8 @@ MouseProc(DeviceIntPtr device, int what) pInfo->fd = -1; if (pMse->emulate3Buttons || pMse->emulate3ButtonsSoft) { - RemoveBlockAndWakeupHandlers (MouseBlockHandler, MouseWakeupHandler, + RemoveBlockAndWakeupHandlers (MouseBlockHandler, + MouseWakeupHandler, (pointer) pInfo); } } @@ -1967,7 +1968,10 @@ Emulate3ButtonsSoft(InputInfoPtr pInfo) buttonTimer(pInfo); xf86Msg(X_INFO,"3rd Button detected: disabling emulate3Button\n"); - + + RemoveBlockAndWakeupHandlers (MouseBlockHandler, MouseWakeupHandler, + (pointer) pInfo); + return FALSE; } commit bc7933171e08215ba28bc06c80ee1bc1febc0522 Author: Peter Hutterer <[email protected]> Date: Wed Sep 9 11:48:58 2009 +1000 mouse 1.4.99.1 Signed-off-by: Peter Hutterer <[email protected]> diff --git a/configure.ac b/configure.ac index 78c278a..8610206 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-input-mouse], - 1.4.0, + 1.4.99.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-input-mouse) commit 04a29c8c8ebc6fbc6f5b67026b659a2ffdd6540b Author: Gaetan Nadon <[email protected]> Date: Mon Sep 7 11:12:13 2009 -0400 xf86-input-mouse: Remove unused .cvsignore file #23776 Signed-off-by: Peter Hutterer <[email protected]> diff --git a/man/.cvsignore b/man/.cvsignore deleted file mode 100644 index 282522d..0000000 --- a/man/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/src/.cvsignore b/src/.cvsignore deleted file mode 100644 index 9730646..0000000 --- a/src/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.la -*.lo commit fa997144458527856b71fa162a105a46af8e688a Author: Donald Kayser <[email protected]> Date: Thu Sep 3 09:22:30 2009 +1000 signed/unsigned fixes for delta x,y movement Changed the cast of (char) to (signed char) while computing delta x and delta y mouse movements. The C standard does not define compiler behavior, and currently with PPC builds, the (char) cast is unsigned. To guarantee that the compiler will generate signed values, the cast has been changed Signed-off-by: Donald Kayser <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> diff --git a/src/mouse.c b/src/mouse.c index aff2512..23dc726 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -1301,8 +1301,8 @@ MouseReadInput(InputInfoPtr pInfo) buttons = (pMse->lastButtons & 2) | ((int)(pBuf[0] & 0x20) >> 3) | ((int)(pBuf[0] & 0x10) >> 4); - dx = (char)(((pBuf[0] & 0x03) << 6) | (pBuf[1] & 0x3F)); - dy = (char)(((pBuf[0] & 0x0C) << 4) | (pBuf[2] & 0x3F)); + dx = (signed char)(((pBuf[0] & 0x03) << 6) | (pBuf[1] & 0x3F)); + dy = (signed char)(((pBuf[0] & 0x0C) << 4) | (pBuf[2] & 0x3F)); break; case PROT_GLIDE: /* ALPS GlidePoint */ @@ -1311,14 +1311,14 @@ MouseReadInput(InputInfoPtr pInfo) buttons = (pMse->lastButtons & (8 + 2)) | ((int)(pBuf[0] & 0x20) >> 3) | ((int)(pBuf[0] & 0x10) >> 4); - dx = (char)(((pBuf[0] & 0x03) << 6) | (pBuf[1] & 0x3F)); - dy = (char)(((pBuf[0] & 0x0C) << 4) | (pBuf[2] & 0x3F)); + dx = (signed char)(((pBuf[0] & 0x03) << 6) | (pBuf[1] & 0x3F)); + dy = (signed char)(((pBuf[0] & 0x0C) << 4) | (pBuf[2] & 0x3F)); break; case PROT_MSC: /* Mouse Systems Corp */ buttons = (~pBuf[0]) & 0x07; - dx = (char)(pBuf[1]) + (char)(pBuf[3]); - dy = - ((char)(pBuf[2]) + (char)(pBuf[4])); + dx = (signed char)(pBuf[1]) + (char)(pBuf[3]); + dy = - ((signed char)(pBuf[2]) + (char)(pBuf[4])); break; case PROT_MMHIT: /* MM_HitTablet */ @@ -1346,8 +1346,8 @@ MouseReadInput(InputInfoPtr pInfo) case PROT_BM: /* BusMouse */ buttons = (~pBuf[0]) & 0x07; - dx = (char)pBuf[1]; - dy = - (char)pBuf[2]; + dx = (signed char)pBuf[1]; + dy = - (signed char)pBuf[2]; break; case PROT_PS2: /* PS/2 mouse */ @@ -1511,8 +1511,8 @@ MouseReadInput(InputInfoPtr pInfo) buttons = ((int)(pBuf[0] & 0x20) >> 3) | ((int)(pBuf[0] & 0x10) >> 4) | ((int)(pBuf[3] & 0x10) >> 3); - dx = (char)(((pBuf[0] & 0x03) << 6) | (pBuf[1] & 0x3F)); - dy = (char)(((pBuf[0] & 0x0C) << 4) | (pBuf[2] & 0x3F)); + dx = (signed char)(((pBuf[0] & 0x03) << 6) | (pBuf[1] & 0x3F)); + dy = (signed char)(((pBuf[0] & 0x0C) << 4) | (pBuf[2] & 0x3F)); dz = (pBuf[3] & 0x08) ? ((int)(pBuf[3] & 0x0F) - 0x10) : ((int)(pBuf[3] & 0x0F)); break; commit f292f23baf4db048917a2acd4def9fab4293bc85 Author: Alan Coopersmith <[email protected]> Date: Thu Aug 20 13:49:52 2009 -0700 sun_mouse: Don't try calling ioctls if mouse fd wasn't opened Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/src/sun_mouse.c b/src/sun_mouse.c index 4b531b1..7194f4d 100644 --- a/src/sun_mouse.c +++ b/src/sun_mouse.c @@ -23,7 +23,7 @@ * dealings in this Software without prior written authorization from the * XFree86 Project. */ -/* Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved. +/* Copyright 2004-2005, 2008-2009 Sun Microsystems, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the @@ -204,65 +204,66 @@ vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags) xf86CollectInputOptions(pInfo, NULL, NULL); xf86ProcessCommonOptions(pInfo, pInfo->options); + pVuidMse->buffer = (unsigned char *)&pVuidMse->event; + pVuidMse->strmod = xf86SetStrOption(pInfo->options, "StreamsModule", NULL); + /* Check if the device can be opened. */ pInfo->fd = xf86OpenSerial(pInfo->options); if (pInfo->fd == -1) { - if (xf86GetAllowMouseOpenFail()) + if (xf86GetAllowMouseOpenFail()) { xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name); - else { + } else { xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name); + xfree(pVuidMse->strmod); xfree(pVuidMse); xfree(pMse); return FALSE; } - } - - pVuidMse->buffer = (unsigned char *)&pVuidMse->event; - - pVuidMse->strmod = xf86SetStrOption(pInfo->options, "StreamsModule", NULL); - if (pVuidMse->strmod) { - /* Check to see if module is already pushed */ - SYSCALL(i = ioctl(pInfo->fd, I_FIND, pVuidMse->strmod)); - - if (i == 0) { /* Not already pushed */ - SYSCALL(i = ioctl(pInfo->fd, I_PUSH, pVuidMse->strmod)); - if (i < 0) { - xf86Msg(X_ERROR, + } else { + if (pVuidMse->strmod) { + /* Check to see if module is already pushed */ + SYSCALL(i = ioctl(pInfo->fd, I_FIND, pVuidMse->strmod)); + + if (i == 0) { /* Not already pushed */ + SYSCALL(i = ioctl(pInfo->fd, I_PUSH, pVuidMse->strmod)); + if (i < 0) { + xf86Msg(X_ERROR, "%s: cannot push module '%s' onto mouse device: %s\n", pInfo->name, pVuidMse->strmod, strerror(errno)); - xf86CloseSerial(pInfo->fd); - pInfo->fd = -1; - xfree(pVuidMse->strmod); - xfree(pVuidMse); - xfree(pMse); - return FALSE; + xf86CloseSerial(pInfo->fd); + pInfo->fd = -1; + xfree(pVuidMse->strmod); + xfree(pVuidMse); + xfree(pMse); + return FALSE; + } } } - } - buttons = xf86SetIntOption(pInfo->options, "Buttons", 0); - if (buttons == 0) { - SYSCALL(i = ioctl(pInfo->fd, MSIOBUTTONS, &buttons)); - if (i == 0) { - pInfo->conf_idev->commonOptions = - xf86ReplaceIntOption(pInfo->conf_idev->commonOptions, - "Buttons", buttons); - xf86Msg(X_INFO, "%s: Setting Buttons option to \"%d\"\n", - pInfo->name, buttons); + buttons = xf86SetIntOption(pInfo->options, "Buttons", 0); + if (buttons == 0) { + SYSCALL(i = ioctl(pInfo->fd, MSIOBUTTONS, &buttons)); + if (i == 0) { + pInfo->conf_idev->commonOptions = + xf86ReplaceIntOption(pInfo->conf_idev->commonOptions, + "Buttons", buttons); + xf86Msg(X_INFO, "%s: Setting Buttons option to \"%d\"\n", + pInfo->name, buttons); + } } - } - if (pVuidMse->strmod) { - SYSCALL(i = ioctl(pInfo->fd, I_POP, pVuidMse->strmod)); - if (i == -1) { - xf86Msg(X_WARNING, - "%s: cannot pop module '%s' off mouse device: %s\n", - pInfo->name, pVuidMse->strmod, strerror(errno)); + if (pVuidMse->strmod) { + SYSCALL(i = ioctl(pInfo->fd, I_POP, pVuidMse->strmod)); + if (i == -1) { + xf86Msg(X_WARNING, + "%s: cannot pop module '%s' off mouse device: %s\n", + pInfo->name, pVuidMse->strmod, strerror(errno)); + } } - } - xf86CloseSerial(pInfo->fd); - pInfo->fd = -1; + xf86CloseSerial(pInfo->fd); + pInfo->fd = -1; + } /* Process common mouse options (like Emulate3Buttons, etc). */ pMse->CommonOptions(pInfo); commit f93c927178a352eec00b3323eb935cc6f27243b0 Author: Alan Coopersmith <[email protected]> Date: Thu Aug 20 13:29:25 2009 -0700 Remove check for OS/2 Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/src/mouse.c b/src/mouse.c index 8bd659e..aff2512 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -1007,10 +1007,6 @@ MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) xf86CollectInputOptions(pInfo, pProto->defaults, NULL); xf86ProcessCommonOptions(pInfo, pInfo->options); - /* XXX should handle this OS dependency elsewhere. */ -#ifndef __OS2ELF__ - /* OS/2 has a mouse handled by the OS - it cannot fail here */ - /* Check if the device can be opened. */ pInfo->fd = xf86OpenSerial(pInfo->options); if (pInfo->fd == -1) { @@ -1026,7 +1022,6 @@ MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) } } xf86CloseSerial(pInfo->fd); -#endif pInfo->fd = -1; if (!(mPriv = (pointer) xcalloc(sizeof(mousePrivRec), 1))) commit 1be9e3cf0c491cddfb5985b6b3cc65581313f98f Author: Alan Coopersmith <[email protected]> Date: Thu Aug 20 13:26:40 2009 -0700 sun_mouse: Check if streams module is already on the stack before pushing it Signed-off-by: Alan Coopersmith <[email protected]> diff --git a/src/sun_mouse.c b/src/sun_mouse.c index ac40e07..4b531b1 100644 --- a/src/sun_mouse.c +++ b/src/sun_mouse.c @@ -221,17 +221,22 @@ vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags) pVuidMse->strmod = xf86SetStrOption(pInfo->options, "StreamsModule", NULL); if (pVuidMse->strmod) { - SYSCALL(i = ioctl(pInfo->fd, I_PUSH, pVuidMse->strmod)); - if (i < 0) { - xf86Msg(X_ERROR, - "%s: cannot push module '%s' onto mouse device: %s\n", - pInfo->name, pVuidMse->strmod, strerror(errno)); - xf86CloseSerial(pInfo->fd); - pInfo->fd = -1; - xfree(pVuidMse->strmod); - xfree(pVuidMse); - xfree(pMse); - return FALSE; + /* Check to see if module is already pushed */ + SYSCALL(i = ioctl(pInfo->fd, I_FIND, pVuidMse->strmod)); + + if (i == 0) { /* Not already pushed */ + SYSCALL(i = ioctl(pInfo->fd, I_PUSH, pVuidMse->strmod)); + if (i < 0) { + xf86Msg(X_ERROR, + "%s: cannot push module '%s' onto mouse device: %s\n", + pInfo->name, pVuidMse->strmod, strerror(errno)); + xf86CloseSerial(pInfo->fd); + pInfo->fd = -1; + xfree(pVuidMse->strmod); + xfree(pVuidMse); + xfree(pMse); + return FALSE; + } } } @@ -531,15 +536,21 @@ vuidMouseProc(DeviceIntPtr pPointer, int what) int fmt = VUID_FIRM_EVENT; if (pVuidMse->strmod) { - SYSCALL(i = ioctl(pInfo->fd, I_PUSH, pVuidMse->strmod)); - if (i < 0) { - xf86Msg(X_WARNING, - "%s: cannot push module '%s' onto mouse device: %s\n", - pInfo->name, pVuidMse->strmod, strerror(errno)); - xfree(pVuidMse->strmod); - pVuidMse->strmod = NULL; + /* Check to see if module is already pushed */ + SYSCALL(i = ioctl(pInfo->fd, I_FIND, pVuidMse->strmod)); + + if (i == 0) { /* Not already pushed */ + SYSCALL(i = ioctl(pInfo->fd, I_PUSH, pVuidMse->strmod)); + if (i < 0) { + xf86Msg(X_WARNING, "%s: cannot push module '%s' " + "onto mouse device: %s\n", pInfo->name, + pVuidMse->strmod, strerror(errno)); + xfree(pVuidMse->strmod); + pVuidMse->strmod = NULL; + } } } + SYSCALL(i = ioctl(pInfo->fd, VUIDSFORMAT, &fmt)); if (i < 0) { xf86Msg(X_WARNING, commit bf95ccf496d6674a83c44d559e3eef8729c69449 Author: Dima Kogan <[email protected]> Date: Sun Aug 16 22:27:28 2009 -0700 Restrict wheel emulation to a single axis at a time. Wheel emulation works for both horizontal and vertical axes. Thus, if a device doesn't move in perfect straight line, scroll events build up on the respective other axis. In some clients, scroll wheel events have specific meanings other than scrolling (e.g. mplayer). In these clients, erroneous scrolling events come at a high cost. Thus, if a scroll wheel event is generated for one axis, reset the inertia of the other axis to 0, avoiding the buildup of these erroneous scrolling events. Signed-off-by: Dima Kogan <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> diff --git a/src/mouse.c b/src/mouse.c index 0e22314..8bd659e 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -2102,6 +2102,7 @@ MouseDoPostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy) while (abs(pMse->wheelYDistance) > pMse->wheelInertia) { pMse->wheelYDistance -= emuWheelDelta; + pMse->wheelXDistance = 0; /* * Synthesize the press and release, but not when * the button to be synthesized is already pressed @@ -2129,6 +2130,7 @@ MouseDoPostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy) while (abs(pMse->wheelXDistance) > pMse->wheelInertia) { pMse->wheelXDistance -= emuWheelDelta; + pMse->wheelYDistance = 0; /* * Synthesize the press and release, but not when * the button to be synthesized is already pressed commit 2d43329d778d7bfae5d9c99611ad49efa56716a6 Author: Dima Kogan <[email protected]> Date: Sun Aug 16 21:33:43 2009 -0700 Allow 0 as wheel emulation button for unconditional scrolling (#20529) If wheel emulation is on and the emulation button is 0, then any x/y motion of the device is converted into wheel events. The device becomes a scrolling-only device. Signed-off-by: Dima Kogan <dko...@[email protected]> Signed-off-by: Dima Kogan <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> diff --git a/man/mousedrv.man b/man/mousedrv.man index bc6773f..e805335 100644 --- a/man/mousedrv.man +++ b/man/mousedrv.man @@ -155,7 +155,8 @@ press/release events as specified for the .B XAxisMapping and .B YAxisMapping -settings. Default: 4. +settings. If set to 0, no button is required and any motion of the device +is converted into wheel events. Default: 4. .TP 7 .BI "Option \*qEmulateWheelInertia\*q \*q" integer \*q Specifies how far (in pixels) the pointer must move to generate button diff --git a/src/mouse.c b/src/mouse.c index dd3eb2e..0e22314 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -2059,7 +2059,10 @@ MouseDoPostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy) if (pMse->emulateWheel) { /* Emulate wheel button handling */ - wheelButtonMask = 1 << (pMse->wheelButton - 1); + if(pMse->wheelButton == 0) + wheelButtonMask = 0; + else + wheelButtonMask = 1 << (pMse->wheelButton - 1); if (change & wheelButtonMask) { if (buttons & wheelButtonMask) { @@ -2081,9 +2084,10 @@ MouseDoPostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy) } else ms = pMse->wheelButtonExpires - GetTimeInMillis (); - /* Intercept wheel emulation. */ - if (buttons & wheelButtonMask) { - if (ms <= 0) { + /* Intercept wheel emulation if the necessary button is depressed or + if no button is necessary */ + if ((buttons & wheelButtonMask) || wheelButtonMask==0) { + if (ms <= 0 || wheelButtonMask==0) { /* Y axis movement */ if (pMse->negativeY != MSE_NOAXISMAP) { pMse->wheelYDistance += dy; commit 66bdf8d3f289a3ada44c37f3ceb00fc728975cac Author: Charlie <r...@netbsd.(none)> Date: Thu Jul 9 08:09:54 2009 +0200 Conditionally declare some variables that are only used conditionally. Reviewed-by: Matthieu Herrn <[email protected]> Acked-by: Peter Hutterer <[email protected]> diff --git a/src/mouse.c b/src/mouse.c index fefdc1f..dd3eb2e 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -1593,8 +1593,10 @@ MouseProc(DeviceIntPtr device, int what) mousePrivPtr mPriv; unsigned char map[MSE_MAXBUTTONS + 1]; int i; +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 Atom btn_labels[MSE_MAXBUTTONS] = {0}; Atom axes_labels[2] = { 0, 0 }; +#endif pInfo = device->public.devicePrivate; pMse = pInfo->private; commit 8a3f6f75218080b3e7657cb104c6f8e025f358ef Author: Charlie <r...@netbsd.(none)> Date: Thu Jul 9 08:09:54 2009 +0200 Conditionally declare some variables that are only used conditionally. diff --git a/src/mouse.c b/src/mouse.c index fefdc1f..dd3eb2e 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -1593,8 +1593,10 @@ MouseProc(DeviceIntPtr device, int what) mousePrivPtr mPriv; unsigned char map[MSE_MAXBUTTONS + 1]; int i; +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 Atom btn_labels[MSE_MAXBUTTONS] = {0}; Atom axes_labels[2] = { 0, 0 }; +#endif pInfo = device->public.devicePrivate; pMse = pInfo->private; commit 2ddc4e9b2882914a56508613fe069c7335c64cc7 Author: Peter Hutterer <[email protected]> Date: Thu Jun 18 16:11:47 2009 +1000 Protect against ABI_XINPUT_VERSION 7. Missing the actual button and axis labeling, this can be added at a later point in time. Signed-off-by: Peter Hutterer <[email protected]> diff --git a/src/mouse.c b/src/mouse.c index 898d14d..fefdc1f 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -1593,7 +1593,9 @@ MouseProc(DeviceIntPtr device, int what) mousePrivPtr mPriv; unsigned char map[MSE_MAXBUTTONS + 1]; int i; - + Atom btn_labels[MSE_MAXBUTTONS] = {0}; + Atom axes_labels[2] = { 0, 0 }; + pInfo = device->public.devicePrivate; pMse = pInfo->private; pMse->device = device; @@ -1609,8 +1611,13 @@ MouseProc(DeviceIntPtr device, int what) for (i = 0; i < MSE_MAXBUTTONS; i++) map[i + 1] = i + 1; + /* FIXME: we should probably set the labels here */ + InitPointerDeviceStruct((DevicePtr)device, map, min(pMse->buttons, MSE_MAXBUTTONS), +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + btn_labels, +#endif #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 miPointerGetMotionEvents, #elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 @@ -1622,13 +1629,24 @@ MouseProc(DeviceIntPtr device, int what) #else GetMotionHistorySize(), 2 #endif +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + , axes_labels +#endif ); /* X valuator */ - xf86InitValuatorAxisStruct(device, 0, -1, -1, 1, 0, 1); + xf86InitValuatorAxisStruct(device, 0, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + axes_labels[0], +#endif + -1, -1, 1, 0, 1); xf86InitValuatorDefaults(device, 0); /* Y valuator */ - xf86InitValuatorAxisStruct(device, 1, -1, -1, 1, 0, 1); + xf86InitValuatorAxisStruct(device, 1, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + axes_labels[1], +#endif + -1, -1, 1, 0, 1); xf86InitValuatorDefaults(device, 1); #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 xf86MotionHistoryAllocate(pInfo); commit 91bf15dd2af4bf9a83e317b8821bcbbfdba02338 Author: Peter Hutterer <[email protected]> Date: Fri May 29 10:07:19 2009 +1000 Remove ModuleInfoRec and associated bits. ModuleInfoRec was removed with 2107becb0ce2ffda001be65728c53563496d8d50 from the server. The MouseOpts were only used from the ModuleInfoRec, they're gone now too. Signed-off-by: Peter Hutterer <[email protected]> diff --git a/src/mouse.c b/src/mouse.c index 9614688..898d14d 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -123,8 +123,6 @@ typedef struct _DragLockRec { } DragLockRec, *DragLockPtr; - -static const OptionInfoRec *MouseAvailableOptions(void *unused); static InputInfoPtr MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags); #if 0 static void MouseUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags); @@ -172,91 +170,6 @@ _X_EXPORT InputDriverRec MOUSE = { 0 }; -typedef enum { - OPTION_ALWAYS_CORE, - OPTION_SEND_CORE_EVENTS, - OPTION_CORE_POINTER, - OPTION_SEND_DRAG_EVENTS, - OPTION_HISTORY_SIZE, - OPTION_DEVICE, - OPTION_PROTOCOL, - OPTION_BUTTONS, - OPTION_EMULATE_3_BUTTONS, - OPTION_EMULATE_3_TIMEOUT, - OPTION_CHORD_MIDDLE, - OPTION_FLIP_XY, - OPTION_INV_X, - OPTION_INV_Y, - OPTION_ANGLE_OFFSET, - OPTION_Z_AXIS_MAPPING, - OPTION_SAMPLE_RATE, - OPTION_RESOLUTION, - OPTION_EMULATE_WHEEL, - OPTION_EMU_WHEEL_BUTTON, - OPTION_EMU_WHEEL_INERTIA, - OPTION_EMU_WHEEL_TIMEOUT, - OPTION_X_AXIS_MAPPING, - OPTION_Y_AXIS_MAPPING, - OPTION_AUTO_SOFT, - OPTION_CLEAR_DTR, - OPTION_CLEAR_RTS, - OPTION_BAUD_RATE, - OPTION_DATA_BITS, - OPTION_STOP_BITS, - OPTION_PARITY, - OPTION_FLOW_CONTROL, - OPTION_VTIME, - OPTION_VMIN, - OPTION_DRAGLOCKBUTTONS, - OPTION_DOUBLECLICK_BUTTONS, - OPTION_BUTTON_MAPPING, - OPTION_SENSITIVITY -} MouseOpts; - -static const OptionInfoRec mouseOptions[] = { - { OPTION_ALWAYS_CORE, "AlwaysCore", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_SEND_CORE_EVENTS, "SendCoreEvents", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_CORE_POINTER, "CorePointer", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_SEND_DRAG_EVENTS, "SendDragEvents", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_HISTORY_SIZE, "HistorySize", OPTV_INTEGER, {0}, FALSE }, - { OPTION_DEVICE, "Device", OPTV_STRING, {0}, FALSE }, - { OPTION_PROTOCOL, "Protocol", OPTV_STRING, {0}, FALSE }, - { OPTION_BUTTONS, "Buttons", OPTV_INTEGER, {0}, FALSE }, - { OPTION_EMULATE_3_BUTTONS, "Emulate3Buttons",OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_EMULATE_3_TIMEOUT, "Emulate3Timeout",OPTV_INTEGER, {0}, FALSE }, - { OPTION_CHORD_MIDDLE, "ChordMiddle", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_FLIP_XY, "FlipXY", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_INV_X, "InvX", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_INV_Y, "InvY", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_ANGLE_OFFSET, "AngleOffset", OPTV_INTEGER, {0}, FALSE }, - { OPTION_Z_AXIS_MAPPING, "ZAxisMapping", OPTV_STRING, {0}, FALSE }, - { OPTION_SAMPLE_RATE, "SampleRate", OPTV_INTEGER, {0}, FALSE }, - { OPTION_RESOLUTION, "Resolution", OPTV_INTEGER, {0}, FALSE }, - { OPTION_EMULATE_WHEEL, "EmulateWheel", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_EMU_WHEEL_BUTTON, "EmulateWheelButton", OPTV_INTEGER, {0}, FALSE }, - { OPTION_EMU_WHEEL_INERTIA, "EmulateWheelInertia", OPTV_INTEGER, {0}, FALSE }, - { OPTION_EMU_WHEEL_TIMEOUT, "EmulateWheelTimeout", OPTV_INTEGER, {0}, FALSE }, - { OPTION_X_AXIS_MAPPING, "XAxisMapping", OPTV_STRING, {0}, FALSE }, - { OPTION_Y_AXIS_MAPPING, "YAxisMapping", OPTV_STRING, {0}, FALSE }, - { OPTION_AUTO_SOFT, "AutoSoft", OPTV_BOOLEAN, {0}, FALSE }, - /* serial options */ - { OPTION_CLEAR_DTR, "ClearDTR", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_CLEAR_RTS, "ClearRTS", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_BAUD_RATE, "BaudRate", OPTV_INTEGER, {0}, FALSE }, - { OPTION_DATA_BITS, "DataBits", OPTV_INTEGER, {0}, FALSE }, - { OPTION_STOP_BITS, "StopBits", OPTV_INTEGER, {0}, FALSE }, - { OPTION_PARITY, "Parity", OPTV_STRING, {0}, FALSE }, - { OPTION_FLOW_CONTROL, "FlowControl", OPTV_STRING, {0}, FALSE }, - { OPTION_VTIME, "VTime", OPTV_INTEGER, {0}, FALSE }, - { OPTION_VMIN, "VMin", OPTV_INTEGER, {0}, FALSE }, - /* end serial options */ - { 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 } -}; - #define RETRY_COUNT 4 /* @@ -372,13 +285,6 @@ static MouseProtocolRec mouseProtocols[] = { { NULL, MSE_NONE, NULL, PROT_UNKNOWN } }; -/*ARGSUSED*/ -static const OptionInfoRec * -MouseAvailableOptions(void *unused) -{ - return (mouseOptions); -} - /* Process options common to all mouse types. */ static void MouseCommonOptions(InputInfoPtr pInfo) @@ -3738,15 +3644,6 @@ collectData(MouseDevPtr pMse, unsigned char u) /**************** end of autoprobe stuff *****************/ - -ModuleInfoRec MouseInfo = { - 1, - "MOUSE", - NULL, - 0, - MouseAvailableOptions, -}; - static void xf86MouseUnplug(pointer p) { commit b698a24ab233ec5da2ebd36b5f6f199219de6d44 Author: Peter Hutterer <[email protected]> Date: Wed Mar 25 08:37:01 2009 +1000 Remove xf86MouseProtocolIDToName and xf86MouseProtocolNameToID. Both were only used from the xf86-misc extension which is gone from the server as of 1.6. Signed-off-by: Peter Hutterer <[email protected]> diff --git a/src/mouse.c b/src/mouse.c index 347afc6..9614688 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -866,18 +866,6 @@ ProtocolIDToName(MouseProtocolID id) } } -_X_EXPORT const char * -xf86MouseProtocolIDToName(MouseProtocolID id) -{ - return ProtocolIDToName(id); -} - -MouseProtocolID -xf86MouseProtocolNameToID(const char *name) -{ - return ProtocolNameToID(name); -} - static int ProtocolIDToClass(MouseProtocolID id) { diff --git a/src/mouse.h b/src/mouse.h index 804a8f4..daefbc5 100644 --- a/src/mouse.h +++ b/src/mouse.h @@ -7,7 +7,4 @@ #include "xf86OSmouse.h" -_X_EXPORT const char * xf86MouseProtocolIDToName(MouseProtocolID id); -MouseProtocolID xf86MouseProtocolNameToID(const char *name); - #endif commit 6887ca0de8314b6029d5df63777b29c46eeb9442 Author: Peter Hutterer <[email protected]> Date: Wed Mar 25 08:45:10 2009 +1000 Require xorg-server 1.5.99.901 or higher. 1.6 is the first server release that has the xf86OSmouse.h and related code removed. This code has moved into the mouse driver and attempts of using a mouse driver that provides xf86OSmouse.h with a pre-1.6 xserver may fail. See also: http://lists.freedesktop.org/archives/xorg/2009-March/044501.html Reported-by: Jeremy C. Reed <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> diff --git a/configure.ac b/configure.ac index db57697..78c278a 100644 --- a/configure.ac +++ b/configure.ac @@ -62,7 +62,7 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) # Checks for pkg-config packages -PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto $REQUIRED_MODULES) +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.5.99.901] xproto $REQUIRED_MODULES) sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server` # Checks for libraries. commit abc65bec5c88acd0a8699920e18473cfa007169f Author: Paulo Cesar Pereira de Andrade <[email protected]> Date: Wed Feb 4 20:48:33 2009 -0200 Janitor: use $PKG_CONFIG and update .gitignore. Signed-off-by: Paulo Cesar Pereira de Andrade <[email protected]> diff --git a/.gitignore b/.gitignore index 2df4a8d..dfb9348 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.deps +.libs Makefile Makefile.in *.la @@ -18,3 +20,7 @@ ltmain.sh missing stamp-h1 *~ +*.4 +xf86-input-mouse-*.tar.* +ChangeLog +tags diff --git a/configure.ac b/configure.ac index 9c4f034..db57697 100644 --- a/configure.ac +++ b/configure.ac @@ -63,7 +63,7 @@ XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) # Checks for pkg-config packages PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto $REQUIRED_MODULES) -sdkdir=$(pkg-config --variable=sdkdir xorg-server) +sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server` # Checks for libraries. -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

