From 15d45d78585d6e9fb779aa8d0c1ac81d390fd444 Mon Sep 17 00:00:00 2001 From: wiz Date: Mon, 19 Aug 2013 09:19:27 +0000 Subject: Add all patches from NetBSD xsrc, as sent upstream just a minute ago. Bump PKGREVISION. --- x11/xf86-input-mouse/Makefile | 3 +- x11/xf86-input-mouse/distinfo | 5 +- .../patches/patch-src_bsd__mouse.c | 55 +++++++++++++++++++--- x11/xf86-input-mouse/patches/patch-src_mouse.c | 50 ++++++++++++++++++++ 4 files changed, 104 insertions(+), 9 deletions(-) create mode 100644 x11/xf86-input-mouse/patches/patch-src_mouse.c (limited to 'x11') diff --git a/x11/xf86-input-mouse/Makefile b/x11/xf86-input-mouse/Makefile index 70c6a46b404..de1f715d3f3 100644 --- a/x11/xf86-input-mouse/Makefile +++ b/x11/xf86-input-mouse/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.19 2013/06/16 02:01:54 obache Exp $ +# $NetBSD: Makefile,v 1.20 2013/08/19 09:19:27 wiz Exp $ DISTNAME= xf86-input-mouse-1.9.0 +PKGREVISION= 1 CATEGORIES= x11 MASTER_SITES= ${MASTER_SITE_XORG:=driver/} EXTRACT_SUFX= .tar.bz2 diff --git a/x11/xf86-input-mouse/distinfo b/x11/xf86-input-mouse/distinfo index 6084f2d87a6..17e5fda6ad5 100644 --- a/x11/xf86-input-mouse/distinfo +++ b/x11/xf86-input-mouse/distinfo @@ -1,6 +1,7 @@ -$NetBSD: distinfo,v 1.14 2013/06/16 02:01:54 obache Exp $ +$NetBSD: distinfo,v 1.15 2013/08/19 09:19:27 wiz Exp $ SHA1 (xf86-input-mouse-1.9.0.tar.bz2) = 5f9e5f450100252efa4f8b074fbb262c42811d46 RMD160 (xf86-input-mouse-1.9.0.tar.bz2) = 710d721f91018a25068396248315c1f933ee31db Size (xf86-input-mouse-1.9.0.tar.bz2) = 353339 bytes -SHA1 (patch-src_bsd__mouse.c) = 8191852ac5d28f17a7aaa1c32859fe27b6211ce8 +SHA1 (patch-src_bsd__mouse.c) = 1714bf37f1c89097c341a7c1749cadfebec94411 +SHA1 (patch-src_mouse.c) = ff5353e64f815e796461c067d98538167be4de34 diff --git a/x11/xf86-input-mouse/patches/patch-src_bsd__mouse.c b/x11/xf86-input-mouse/patches/patch-src_bsd__mouse.c index 9477cb7e0af..edfd51e6fb9 100644 --- a/x11/xf86-input-mouse/patches/patch-src_bsd__mouse.c +++ b/x11/xf86-input-mouse/patches/patch-src_bsd__mouse.c @@ -1,15 +1,58 @@ -$NetBSD: patch-src_bsd__mouse.c,v 1.1 2013/06/16 02:05:20 obache Exp $ +$NetBSD: patch-src_bsd__mouse.c,v 1.2 2013/08/19 09:19:27 wiz Exp $ -* enable MSE_MISC on netbsd as well, otherwise we can't find WSMouse. +Add MSE_MISC on NetBSD as well, so mouse is found correctly. +Add absolute positioning support. --- src/bsd_mouse.c.orig 2012-10-08 01:40:07.000000000 +0000 +++ src/bsd_mouse.c -@@ -98,7 +98,7 @@ static int +@@ -97,9 +97,7 @@ static const char *mouseDevs[] = { + static int SupportedInterfaces(void) { - #if defined(__NetBSD__) +-#if defined(__NetBSD__) - return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO; -+ return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_MISC; - #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__NetBSD__) return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_MISC; #else + return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO | MSE_MISC; +@@ -409,7 +407,7 @@ wsconsReadInput(InputInfoPtr pInfo) + n /= sizeof(struct wscons_event); + while( n-- ) { + int buttons = pMse->lastButtons; +- int dx = 0, dy = 0, dz = 0, dw = 0; ++ int dx = 0, dy = 0, dz = 0, dw = 0, x, y; + switch (event->type) { + case WSCONS_EVENT_MOUSE_UP: + #define BUTBIT (1 << (event->value <= 2 ? 2 - event->value : event->value)) +@@ -434,6 +432,30 @@ wsconsReadInput(InputInfoPtr pInfo) + dw = event->value; + break; + #endif ++ case WSCONS_EVENT_MOUSE_ABSOLUTE_X: ++ miPointerGetPosition (pInfo->dev, &x, &y); ++ x = event->value; ++ miPointerSetPosition (pInfo->dev, Absolute, (double *)&x, (double *)&y); ++ xf86PostMotionEvent(pInfo->dev, TRUE, 0, 2, x, y); ++ ++event; ++ continue; ++ case WSCONS_EVENT_MOUSE_ABSOLUTE_Y: ++ miPointerGetPosition (pInfo->dev, &x, &y); ++ y = event->value; ++ miPointerSetPosition (pInfo->dev, Absolute, (double *)&x, (double *)&y); ++ xf86PostMotionEvent(pInfo->dev, TRUE, 0, 2, x, y); ++ ++event; ++ continue; ++#ifdef WSCONS_EVENT_MOUSE_ABSOLUTE_Z ++ case WSCONS_EVENT_MOUSE_ABSOLUTE_Z: ++ ++event; ++ continue; ++#endif ++#ifdef WSCONS_EVENT_MOUSE_ABSOLUTE_W ++ case WSCONS_EVENT_MOUSE_ABSOLUTE_W: ++ ++event; ++ continue; ++#endif + default: + LogMessageVerbSigSafe(X_WARNING, -1, + "%s: bad wsmouse event type=%d\n", pInfo->name, diff --git a/x11/xf86-input-mouse/patches/patch-src_mouse.c b/x11/xf86-input-mouse/patches/patch-src_mouse.c new file mode 100644 index 00000000000..6ca95bfdac8 --- /dev/null +++ b/x11/xf86-input-mouse/patches/patch-src_mouse.c @@ -0,0 +1,50 @@ +$NetBSD: patch-src_mouse.c,v 1.1 2013/08/19 09:19:27 wiz Exp $ + +Set mouse protocol version, so xserver knows how to talk to us. +Do not lose emulate3buttons setting for multiplexed mouse. + +--- src/mouse.c.orig 2012-10-08 01:40:07.000000000 +0000 ++++ src/mouse.c +@@ -67,6 +67,12 @@ + #include "xserver-properties.h" + #include "xf86-mouse-properties.h" + ++#ifdef __NetBSD__ ++#include ++#include ++#include ++#endif ++ + #include "compiler.h" + + #include "xisb.h" +@@ -1733,6 +1739,11 @@ MouseProc(DeviceIntPtr device, int what) + if (pInfo->fd == -1) + xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name); + else { ++#if defined(__NetBSD__) && defined(WSCONS_SUPPORT) && defined(WSMOUSEIO_SETVERSION) ++ int version = WSMOUSE_EVENT_VERSION; ++ if (ioctl(pInfo->fd, WSMOUSEIO_SETVERSION, &version) == -1) ++ xf86Msg(X_WARNING, "%s: cannot set version\n", pInfo->name); ++#endif + if (pMse->xisbscale) + pMse->buffer = XisbNew(pInfo->fd, pMse->xisbscale * 4); + else +@@ -2046,6 +2057,17 @@ Emulate3ButtonsSoft(InputInfoPtr pInfo) + if (!pMse->emulate3ButtonsSoft) + return TRUE; + ++#if defined(__NetBSD__) && defined(WSCONS_SUPPORT) ++ /* ++ * On NetBSD a wsmouse is a multiplexed device. Imagine a notebook ++ * with two-button mousepad, and an external USB mouse plugged in ++ * temporarily. After using button 3 on the external mouse and ++ * unplugging it again, the mousepad will still need to emulate ++ * 3 buttons. ++ */ ++ return TRUE; ++#endif ++ + LogMessageVerbSigSafe(X_INFO, 4, "mouse: 3rd Button detected: disabling emulate3Button\n"); + + Emulate3ButtonsSetEnabled(pInfo, FALSE); -- cgit v1.2.3