diff options
author | René Nussbaumer <killerfox@gentoo.org> | 2008-01-11 19:57:48 +0000 |
---|---|---|
committer | René Nussbaumer <killerfox@gentoo.org> | 2008-01-11 19:57:48 +0000 |
commit | 7abd30abc3ffcfeb9f5abcfd796d6910353d9650 (patch) | |
tree | 183cd3dbacc35e683f6b467cb61e12b0c06a185d /x11-drivers/synaptics | |
parent | Fix ${ROOT} issues (diff) | |
download | gentoo-2-7abd30abc3ffcfeb9f5abcfd796d6910353d9650.tar.gz gentoo-2-7abd30abc3ffcfeb9f5abcfd796d6910353d9650.tar.bz2 gentoo-2-7abd30abc3ffcfeb9f5abcfd796d6910353d9650.zip |
Revision bump fixing event device grabbing.
(Portage version: 2.1.3.19)
Diffstat (limited to 'x11-drivers/synaptics')
-rw-r--r-- | x11-drivers/synaptics/ChangeLog | 10 | ||||
-rw-r--r-- | x11-drivers/synaptics/files/digest-synaptics-0.14.6-r1 | 3 | ||||
-rw-r--r-- | x11-drivers/synaptics/files/synaptics-fixeventgrab.diff | 83 | ||||
-rw-r--r-- | x11-drivers/synaptics/synaptics-0.14.6-r1.ebuild | 51 |
4 files changed, 145 insertions, 2 deletions
diff --git a/x11-drivers/synaptics/ChangeLog b/x11-drivers/synaptics/ChangeLog index 04e8aea450ed..86438b8f7055 100644 --- a/x11-drivers/synaptics/ChangeLog +++ b/x11-drivers/synaptics/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for x11-drivers/synaptics -# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/synaptics/ChangeLog,v 1.29 2007/10/09 07:57:35 dberkholz Exp $ +# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/synaptics/ChangeLog,v 1.30 2008/01/11 19:57:47 killerfox Exp $ + +*synaptics-0.14.6-r1 (11 Jan 2008) + + 11 Jan 2008; René Nussbaumer <killerfox@gentoo.org> + +files/synaptics-fixeventgrab.diff, +synaptics-0.14.6-r1.ebuild: + Revision bump fixing event device grabbing. 09 Oct 2007; Donnie Berkholz <dberkholz@gentoo.org>; synaptics-0.14.5-r1.ebuild, synaptics-0.14.6.ebuild: diff --git a/x11-drivers/synaptics/files/digest-synaptics-0.14.6-r1 b/x11-drivers/synaptics/files/digest-synaptics-0.14.6-r1 new file mode 100644 index 000000000000..5d3ea56e43f5 --- /dev/null +++ b/x11-drivers/synaptics/files/digest-synaptics-0.14.6-r1 @@ -0,0 +1,3 @@ +MD5 1102cd575045640a064ab6f9b1e391af synaptics-0.14.6.tar.bz2 126833 +RMD160 7a8b103aa314eb13dc512c663c501108cc24a574 synaptics-0.14.6.tar.bz2 126833 +SHA256 f88b967258a0484b0aa02f26acfb31a70cc8afd4872608b7f81c44dc29ae8429 synaptics-0.14.6.tar.bz2 126833 diff --git a/x11-drivers/synaptics/files/synaptics-fixeventgrab.diff b/x11-drivers/synaptics/files/synaptics-fixeventgrab.diff new file mode 100644 index 000000000000..8a93988e0120 --- /dev/null +++ b/x11-drivers/synaptics/files/synaptics-fixeventgrab.diff @@ -0,0 +1,83 @@ +diff -urN synaptics-0.14.6.orig/eventcomm.c synaptics-0.14.6/eventcomm.c +--- synaptics-0.14.6.orig/eventcomm.c 2006-07-15 17:54:29.000000000 +0200 ++++ synaptics-0.14.6/eventcomm.c 2008-01-06 23:44:09.000000000 +0100 +@@ -40,16 +40,24 @@ + * Function Definitions + ****************************************************************************/ + +-static void ++static Bool ++grab_event_device(int fd) ++{ ++ int ret; ++ SYSCALL(ret = ioctl(fd, EVIOCGRAB, (pointer)1)); ++ return !(ret < 0); ++} ++ ++static Bool + EventDeviceOnHook(LocalDevicePtr local) + { + /* Try to grab the event device so that data don't leak to /dev/input/mice */ +- int ret; +- SYSCALL(ret = ioctl(local->fd, EVIOCGRAB, (pointer)1)); +- if (ret < 0) { ++ if(!grab_event_device(local->fd)) { + xf86Msg(X_WARNING, "%s can't grab event device, errno=%d\n", + local->name, errno); ++ return FALSE; + } ++ return TRUE; + } + + static void +@@ -247,6 +255,7 @@ + char fname[64]; + int fd = -1; + Bool is_touchpad; ++ Bool is_grabbable; + + sprintf(fname, "%s/%s%d", DEV_INPUT_EVENT, EVENT_DEV_NAME, i); + SYSCALL(fd = open(fname, O_RDONLY)); +@@ -263,8 +272,16 @@ + noent_cnt = 0; + have_evdev = TRUE; + is_touchpad = event_query_is_touchpad(fd); ++ /** ++ * Check whether device can be grabbed. This means there is a race ++ * condition with EventDeviceOnHook, which can't be solved cleanly ++ * the way things are done with the current design. One possible ++ * solution would be to keep the file descriptor open. ++ */ ++ is_grabbable = grab_event_device(fd); ++ + SYSCALL(close(fd)); +- if (is_touchpad) { ++ if (is_touchpad && is_grabbable) { + xf86Msg(X_PROBED, "%s auto-dev sets device to %s\n", + local->name, fname); + xf86ReplaceStrOption(local->options, "Device", fname); +diff -urN synaptics-0.14.6.orig/synaptics.c synaptics-0.14.6/synaptics.c +--- synaptics-0.14.6.orig/synaptics.c 2006-07-15 17:54:29.000000000 +0200 ++++ synaptics-0.14.6/synaptics.c 2008-01-06 23:03:26.000000000 +0100 +@@ -543,7 +543,8 @@ + return !Success; + } + +- priv->proto_ops->DeviceOnHook(local); ++ if(!priv->proto_ops->DeviceOnHook(local)) ++ return !Success; + + priv->comm.buffer = XisbNew(local->fd, 64); + if (!priv->comm.buffer) { +diff -urN synaptics-0.14.6.orig/synproto.h synaptics-0.14.6/synproto.h +--- synaptics-0.14.6.orig/synproto.h 2006-07-09 18:53:02.000000000 +0200 ++++ synaptics-0.14.6/synproto.h 2008-01-06 22:31:19.000000000 +0100 +@@ -76,7 +76,7 @@ + struct CommData; + + struct SynapticsProtocolOperations { +- void (*DeviceOnHook)(LocalDevicePtr local); ++ Bool (*DeviceOnHook)(LocalDevicePtr local); + void (*DeviceOffHook)(LocalDevicePtr local); + Bool (*QueryHardware)(LocalDevicePtr local, struct SynapticsHwInfo *synhw); + Bool (*ReadHwState)(LocalDevicePtr local, struct SynapticsHwInfo *synhw, diff --git a/x11-drivers/synaptics/synaptics-0.14.6-r1.ebuild b/x11-drivers/synaptics/synaptics-0.14.6-r1.ebuild new file mode 100644 index 000000000000..27b51d747a7b --- /dev/null +++ b/x11-drivers/synaptics/synaptics-0.14.6-r1.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/synaptics/synaptics-0.14.6-r1.ebuild,v 1.1 2008/01/11 19:57:47 killerfox Exp $ + +inherit toolchain-funcs eutils + +IUSE="" + +DESCRIPTION="Driver for Synaptics touchpads" +HOMEPAGE="http://w1.894.telia.com/~u89404340/touchpad/" +SRC_URI="http://w1.894.telia.com/~u89404340/touchpad/files/${P}.tar.bz2" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" + +RDEPEND="x11-libs/libXext" +DEPEND="${RDEPEND} + x11-base/xorg-server + >=sys-apps/sed-4" + +src_unpack() { + unpack ${A} ; cd "${S}" + + # Switch up the CC and CFLAGS stuff. + sed -i \ + -e "s:CC = gcc:CC = $(tc-getCC):g" \ + -e "s:CDEBUGFLAGS = -O2:CDEBUGFLAGS = ${CFLAGS}:g" \ + "${S}"/Makefile + epatch "${FILESDIR}"/synaptics-fixeventgrab.diff + epatch "${FILESDIR}"/synaptics_input_api.diff +} + +src_compile() { + emake || die +} + +src_install() { + make \ + DESTDIR="${D}" \ + PREFIX=/usr \ + MANDIR="${D}"/usr/share/man \ + install || die + + dodoc script/usbmouse script/usbhid alps.patch trouble-shooting.txt + dodoc COMPATIBILITY FILES INSTALL* LICENSE NEWS TODO README* + + # Stupid new daemon, didn't work for me because of shm issues + newinitd "${FILESDIR}"/rc.init syndaemon + newconfd "${FILESDIR}"/rc.conf syndaemon +} |