add synaptics
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@496 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
13
x11-drivers/synaptics/files/11-x11-synaptics.fdi
Normal file
13
x11-drivers/synaptics/files/11-x11-synaptics.fdi
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<deviceinfo version="0.2">
|
||||
<device>
|
||||
<match key="info.capabilities" contains="input.touchpad">
|
||||
<match key="info.product" contains="Synaptics TouchPad">
|
||||
<merge key="input.x11_driver" type="string">synaptics</merge>
|
||||
</match>
|
||||
<match key="info.product" contains="AlpsPS/2 ALPS">
|
||||
<merge key="input.x11_driver" type="string">synaptics</merge>
|
||||
</match>
|
||||
</match>
|
||||
</device>
|
||||
</deviceinfo>
|
||||
8
x11-drivers/synaptics/files/rc.conf
Normal file
8
x11-drivers/synaptics/files/rc.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
# Copyright 1999-2003 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/x11-drivers/synaptics/files/rc.conf,v 1.1 2005/12/09 16:11:18 seemant Exp $
|
||||
|
||||
# Config file for /etc/init.d/syndaemon
|
||||
|
||||
# run `syndaemon --help` for valid cmdline options
|
||||
#SYNDAEMON_OPTS=""
|
||||
20
x11-drivers/synaptics/files/rc.init
Normal file
20
x11-drivers/synaptics/files/rc.init
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright 1999-2002 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/x11-drivers/synaptics/files/rc.init,v 1.2 2006/12/19 01:07:10 lu_zero Exp $
|
||||
|
||||
depend() {
|
||||
use localmount
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting syndaemon"
|
||||
/usr/bin/syndaemon ${SYNDAEMON_OPTS}
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping syndaemon"
|
||||
kill `cat /var/run/syndaemon.pid`
|
||||
eend $?
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
--- Makefile.orig 2005-12-15 16:07:36.000000000 -0500
|
||||
+++ Makefile 2005-12-15 16:08:45.000000000 -0500
|
||||
@@ -62,9 +62,9 @@
|
||||
|
||||
CCOPTIONS := -pedantic -Wall -Wpointer-arith
|
||||
CCOPTIONS += $(call check_gcc,-fno-merge-constants,)
|
||||
-CCOPTIONS += $(call check_gcc,-fno-pic,)
|
||||
+CCOPTIONS += $(call check_gcc,)
|
||||
CDEBUGFLAGS = -O2
|
||||
-CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES) -DVERSION="\"$(VERSION)\"" -DVERSION_ID="$(VERSION_ID)"
|
||||
+CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES) -DVERSION="\"$(VERSION)\"" -DVERSION_ID="$(VERSION_ID)" -fPIC
|
||||
CFLAGSCLIENT = $(CDEBUGFLAGS) $(CCOPTIONS) -DVERSION="\"$(VERSION)\"" -DVERSION_ID="$(VERSION_ID)" -I$(X_INCLUDES_ROOT)/include
|
||||
|
||||
CC = gcc
|
||||
@@ -0,0 +1,16 @@
|
||||
--- Makefile.orig 2005-12-15 16:07:36.000000000 -0500
|
||||
+++ Makefile 2005-12-15 16:08:45.000000000 -0500
|
||||
@@ -7,10 +7,10 @@
|
||||
# Define the TOP variable to build using include files from a local source tree.
|
||||
#TOP = /usr/src/redhat/BUILD/XFree86-4.3.0/xc
|
||||
|
||||
-INSTALLED_X = $(DESTDIR)/usr/X11R6
|
||||
+INSTALLED_X = $(DESTDIR)/usr
|
||||
LOCAL_X = Xincludes/usr/X11R6
|
||||
-BINDIR = $(DESTDIR)/usr/local/bin
|
||||
-MANDIR = $(DESTDIR)/usr/local/man
|
||||
+BINDIR = $(DESTDIR)/usr/bin
|
||||
+MANDIR = $(DESTDIR)/usr/share/man
|
||||
|
||||
ifeq ($(ARCH),)
|
||||
ARCH = $(shell /bin/arch)
|
||||
@@ -0,0 +1,11 @@
|
||||
--- Makefile.orig 2006-06-04 09:50:43.000000000 +0100
|
||||
+++ Makefile 2006-06-04 09:50:53.000000000 +0100
|
||||
@@ -81,7 +81,7 @@
|
||||
CCOPTIONS := -pedantic -Wall -Wpointer-arith
|
||||
CCOPTIONS += $(call check_gcc,-fno-merge-constants,)
|
||||
CDEBUGFLAGS = -O2
|
||||
-CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES) -DVERSION="\"$(VERSION)\"" -DVERSION_ID="$(VERSION_ID)"
|
||||
+CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES) -DVERSION="\"$(VERSION)\"" -DVERSION_ID="$(VERSION_ID)" -fPIC
|
||||
CFLAGSCLIENT = $(CDEBUGFLAGS) $(CCOPTIONS) -DVERSION="\"$(VERSION)\"" -DVERSION_ID="$(VERSION_ID)" -I$(X_INCLUDES_ROOT)/include
|
||||
|
||||
CC = gcc
|
||||
@@ -0,0 +1,97 @@
|
||||
|
||||
|
||||
|
||||
|
||||
Fix compile errors when using Xorg 7.1.
|
||||
|
||||
From: Peter Osterlund <petero2@telia.com>
|
||||
|
||||
Initial patch from VMiklos <vmiklos@frugalware.org>. Somewhat
|
||||
modified by me.
|
||||
---
|
||||
|
||||
eventcomm.c | 5 +++++
|
||||
ps2comm.h | 1 +
|
||||
psmcomm.c | 2 ++
|
||||
psmcomm.h | 1 +
|
||||
synaptics.c | 1 +
|
||||
synproto.h | 1 +
|
||||
6 files changed, 11 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/eventcomm.c b/eventcomm.c
|
||||
index 6f6de7f..1b0f8bc 100644
|
||||
--- a/eventcomm.c
|
||||
+++ b/eventcomm.c
|
||||
@@ -18,6 +18,11 @@
|
||||
*/
|
||||
|
||||
#include "eventcomm.h"
|
||||
+#include <errno.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <stdio.h>
|
||||
#include "synproto.h"
|
||||
#include "synaptics.h"
|
||||
#include <xf86.h>
|
||||
diff --git a/ps2comm.h b/ps2comm.h
|
||||
index d6f0a25..4a1a051 100644
|
||||
--- a/ps2comm.h
|
||||
+++ b/ps2comm.h
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef _PS2COMM_H_
|
||||
#define _PS2COMM_H_
|
||||
|
||||
+#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include "xf86_OSproc.h"
|
||||
|
||||
diff --git a/psmcomm.c b/psmcomm.c
|
||||
index e4df42b..257ec13 100644
|
||||
--- a/psmcomm.c
|
||||
+++ b/psmcomm.c
|
||||
@@ -29,6 +29,8 @@
|
||||
*/
|
||||
|
||||
#include "psmcomm.h"
|
||||
+#include <errno.h>
|
||||
+#include <string.h>
|
||||
#include "synproto.h"
|
||||
#include "synaptics.h"
|
||||
#include "ps2comm.h" /* ps2_print_ident() */
|
||||
diff --git a/psmcomm.h b/psmcomm.h
|
||||
index 6d64df6..a3162a2 100644
|
||||
--- a/psmcomm.h
|
||||
+++ b/psmcomm.h
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef _PSMCOMM_H_
|
||||
#define _PSMCOMM_H_
|
||||
|
||||
+#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include "freebsd_mouse.h"
|
||||
|
||||
diff --git a/synaptics.c b/synaptics.c
|
||||
index 2a17f81..63edebb 100644
|
||||
--- a/synaptics.c
|
||||
+++ b/synaptics.c
|
||||
@@ -59,6 +59,7 @@
|
||||
* Standard Headers
|
||||
****************************************************************************/
|
||||
|
||||
+#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <misc.h>
|
||||
#include <xf86.h>
|
||||
diff --git a/synproto.h b/synproto.h
|
||||
index 8562a75..ecc4357 100644
|
||||
--- a/synproto.h
|
||||
+++ b/synproto.h
|
||||
@@ -19,6 +19,7 @@
|
||||
#ifndef _SYNPROTO_H_
|
||||
#define _SYNPROTO_H_
|
||||
|
||||
+#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <xf86Xinput.h>
|
||||
#include <xisb.h>
|
||||
@@ -0,0 +1,58 @@
|
||||
--- ./syndaemon.c 2006-04-16 21:31:43.000000000 +0200
|
||||
+++ ./syndaemon.c 2007-10-16 13:40:02.000000000 +0200
|
||||
@@ -43,9 +43,11 @@
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
- fprintf(stderr, "Usage: syndaemon [-i idle-time] [-d] [-t] [-k]\n");
|
||||
+ fprintf(stderr, "Usage: syndaemon [-i idle-time] [-m poll-delay] [-d] [-t] [-k]\n");
|
||||
fprintf(stderr, " -i How many seconds to wait after the last key press before\n");
|
||||
fprintf(stderr, " enabling the touchpad. (default is 2.0s)\n");
|
||||
+ fprintf(stderr, " -m How many milli-seconds to wait until next poll.\n");
|
||||
+ fprintf(stderr, " (default is 20ms)\n");
|
||||
fprintf(stderr, " -d Start as a daemon, ie in the background.\n");
|
||||
fprintf(stderr, " -p Create a pid file with the specified name.\n");
|
||||
fprintf(stderr, " -t Only disable tapping and scrolling, not mouse movements.\n");
|
||||
@@ -159,9 +161,8 @@
|
||||
}
|
||||
|
||||
static void
|
||||
-main_loop(Display *display, double idle_time)
|
||||
+main_loop(Display *display, double idle_time, int poll_delay)
|
||||
{
|
||||
- const int poll_delay = 20000; /* 20 ms */
|
||||
double last_activity = 0.0;
|
||||
double current_time;
|
||||
|
||||
@@ -228,17 +229,21 @@
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
double idle_time = 2.0;
|
||||
+ int poll_delay = 20000; /* 20 ms */
|
||||
Display *display;
|
||||
int c;
|
||||
int shmid;
|
||||
int ignore_modifier_keys = 0;
|
||||
|
||||
/* Parse command line parameters */
|
||||
- while ((c = getopt(argc, argv, "i:dtp:kK?")) != EOF) {
|
||||
+ while ((c = getopt(argc, argv, "i:m:dtp:kK?")) != EOF) {
|
||||
switch(c) {
|
||||
case 'i':
|
||||
idle_time = atof(optarg);
|
||||
break;
|
||||
+ case 'm':
|
||||
+ poll_delay = atoi(optarg) * 1000;
|
||||
+ break;
|
||||
case 'd':
|
||||
background = 1;
|
||||
break;
|
||||
@@ -314,7 +319,7 @@
|
||||
setup_keyboard_mask(display, ignore_modifier_keys);
|
||||
|
||||
/* Run the main loop */
|
||||
- main_loop(display, idle_time);
|
||||
+ main_loop(display, idle_time, poll_delay);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
diff -urN synaptics-0.14.6_p20070706.orig/eventcomm.c synaptics-0.14.6_p20070706/eventcomm.c
|
||||
--- synaptics-0.14.6_p20070706.orig/eventcomm.c 2008-08-29 09:34:11.000000000 +0200
|
||||
+++ synaptics-0.14.6_p20070706/eventcomm.c 2008-08-29 10:23:04.000000000 +0200
|
||||
@@ -41,17 +41,25 @@
|
||||
* 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, SynapticsSHM *para)
|
||||
{
|
||||
if (para->grab_event_device) {
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,6 +281,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));
|
||||
@@ -289,7 +298,14 @@
|
||||
noent_cnt = 0;
|
||||
have_evdev = TRUE;
|
||||
is_touchpad = event_query_is_touchpad(fd);
|
||||
- if (is_touchpad) {
|
||||
+ /**
|
||||
+ * 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);
|
||||
+ 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_p20070706.orig/synaptics.c synaptics-0.14.6_p20070706/synaptics.c
|
||||
--- synaptics-0.14.6_p20070706.orig/synaptics.c 2008-08-29 09:34:11.000000000 +0200
|
||||
+++ synaptics-0.14.6_p20070706/synaptics.c 2008-08-29 10:26:01.000000000 +0200
|
||||
@@ -595,7 +595,8 @@
|
||||
return !Success;
|
||||
}
|
||||
|
||||
- priv->proto_ops->DeviceOnHook(local, priv->synpara);
|
||||
+ if(!priv->proto_ops->DeviceOnHook(local, priv->synpara))
|
||||
+ return !Success;
|
||||
|
||||
priv->comm.buffer = XisbNew(local->fd, 64);
|
||||
if (!priv->comm.buffer) {
|
||||
diff -urN synaptics-0.14.6_p20070706.orig/synproto.h synaptics-0.14.6_p20070706/synproto.h
|
||||
--- synaptics-0.14.6_p20070706.orig/synproto.h 2008-08-29 09:34:11.000000000 +0200
|
||||
+++ synaptics-0.14.6_p20070706/synproto.h 2008-08-29 10:28:34.000000000 +0200
|
||||
@@ -77,7 +77,7 @@
|
||||
struct CommData;
|
||||
|
||||
struct SynapticsProtocolOperations {
|
||||
- void (*DeviceOnHook)(LocalDevicePtr local, struct _SynapticsSHM *para);
|
||||
+ Bool (*DeviceOnHook)(LocalDevicePtr local, struct _SynapticsSHM *para);
|
||||
void (*DeviceOffHook)(LocalDevicePtr local);
|
||||
Bool (*QueryHardware)(LocalDevicePtr local, struct SynapticsHwInfo *synhw);
|
||||
Bool (*ReadHwState)(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
|
||||
@@ -0,0 +1,15 @@
|
||||
diff -urN synaptics-0.14.6_p20070706.orig/Makefile synaptics-0.14.6_p20070706/Makefile
|
||||
--- synaptics-0.14.6_p20070706.orig/Makefile 2008-08-29 09:34:11.000000000 +0200
|
||||
+++ synaptics-0.14.6_p20070706/Makefile 2008-08-29 10:40:29.000000000 +0200
|
||||
@@ -34,10 +34,9 @@
|
||||
LDCOMBINEFLAGS = -shared -lc
|
||||
PICFLAG = $(call check_gcc,-fPIC,)
|
||||
X_INCLUDES_ROOT = $(INSTALLED_X)
|
||||
- SDKDIR = $(shell pkg-config xorg-server --variable=sdkdir)
|
||||
ALLINCLUDES = -I. -I$(INSTALLED_X)/include/X11 \
|
||||
-I$(INSTALLED_X)/include/X11/extensions \
|
||||
- -I$(SDKDIR)
|
||||
+ `pkg-config xorg-server --cflags`
|
||||
else
|
||||
INSTALLED_X = /usr/X11R6
|
||||
INPUT_MODULE_DIR = $(DESTDIR)/$(INSTALLED_X)/$(LIBDIR)/modules/input
|
||||
@@ -0,0 +1,16 @@
|
||||
--- Xincludes/usr/X11R6/include/X11/Xfuncproto.h.orig 2005-07-02 12:50:40.000000000 +0200
|
||||
+++ Xincludes/usr/X11R6/include/X11/Xfuncproto.h 2005-07-25 08:13:46.000000000 +0200
|
||||
@@ -69,4 +69,12 @@
|
||||
#endif
|
||||
#endif /* _XFUNCPROTOBEGIN */
|
||||
|
||||
+#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
+# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))
|
||||
+# define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
|
||||
+#else
|
||||
+# define _X_SENTINEL(x)
|
||||
+# define _X_ATTRIBUTE_PRINTF(x,y)
|
||||
+#endif /* GNUC >= 4 */
|
||||
+
|
||||
#endif /* _XFUNCPROTO_H_ */
|
||||
|
||||
131
x11-drivers/synaptics/files/synaptics-fix-xf86_ansic.h.patch
Normal file
131
x11-drivers/synaptics/files/synaptics-fix-xf86_ansic.h.patch
Normal file
@@ -0,0 +1,131 @@
|
||||
diff -Nur synaptics-0.14.6-org/synaptics.c synaptics-0.14.6-patched/synaptics.c
|
||||
--- synaptics-0.14.6-org/synaptics.c 2006-07-15 17:54:29.000000000 +0200
|
||||
+++ synaptics-0.14.6-patched/synaptics.c 2008-06-28 17:52:54.000000000 +0200
|
||||
@@ -61,10 +61,18 @@
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
+#include <string.h>
|
||||
+#include <sys/ipc.h>
|
||||
+#include <sys/shm.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <stdio.h>
|
||||
+#include <math.h>
|
||||
+#include <errno.h>
|
||||
#include <misc.h>
|
||||
#include <xf86.h>
|
||||
#define NEED_XF86_TYPES
|
||||
-#include <xf86_ansic.h>
|
||||
#include <xf86_OSproc.h>
|
||||
#include <xf86Xinput.h>
|
||||
#include "mipointer.h"
|
||||
@@ -224,14 +232,14 @@
|
||||
return TRUE; /* Already allocated */
|
||||
|
||||
if (priv->shm_config) {
|
||||
- if ((shmid = xf86shmget(SHM_SYNAPTICS, 0, 0)) != -1)
|
||||
- xf86shmctl(shmid, XF86IPC_RMID, NULL);
|
||||
- if ((shmid = xf86shmget(SHM_SYNAPTICS, sizeof(SynapticsSHM),
|
||||
- 0777 | XF86IPC_CREAT)) == -1) {
|
||||
+ if ((shmid = shmget(SHM_SYNAPTICS, 0, 0)) != -1)
|
||||
+ shmctl(shmid, IPC_RMID, NULL);
|
||||
+ if ((shmid = shmget(SHM_SYNAPTICS, sizeof(SynapticsSHM),
|
||||
+ 0777 | IPC_CREAT)) == -1) {
|
||||
xf86Msg(X_ERROR, "%s error shmget\n", local->name);
|
||||
return FALSE;
|
||||
}
|
||||
- if ((priv->synpara = (SynapticsSHM*)xf86shmat(shmid, NULL, 0)) == NULL) {
|
||||
+ if ((priv->synpara = (SynapticsSHM*)shmat(shmid, NULL, 0)) == NULL) {
|
||||
xf86Msg(X_ERROR, "%s error shmat\n", local->name);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -257,8 +265,8 @@
|
||||
return;
|
||||
|
||||
if (priv->shm_config) {
|
||||
- if ((shmid = xf86shmget(SHM_SYNAPTICS, 0, 0)) != -1)
|
||||
- xf86shmctl(shmid, XF86IPC_RMID, NULL);
|
||||
+ if ((shmid = shmget(SHM_SYNAPTICS, 0, 0)) != -1)
|
||||
+ shmctl(shmid, IPC_RMID, NULL);
|
||||
} else {
|
||||
xfree(priv->synpara);
|
||||
}
|
||||
@@ -272,7 +280,7 @@
|
||||
char *str_par;
|
||||
double value;
|
||||
str_par = xf86FindOptionValue(options, optname);
|
||||
- if ((!str_par) || (xf86sscanf(str_par, "%lf", &value) != 1))
|
||||
+ if ((!str_par) || (sscanf(str_par, "%lf", &value) != 1))
|
||||
return default_value;
|
||||
return value;
|
||||
}
|
||||
@@ -437,8 +445,8 @@
|
||||
priv->fifofd = -1;
|
||||
if (repeater) {
|
||||
/* create repeater fifo */
|
||||
- if ((xf86mknod(repeater, 666, XF86_S_IFIFO) != 0) &&
|
||||
- (xf86errno != xf86_EEXIST)) {
|
||||
+ if ((mknod(repeater, 666, S_IFIFO) != 0) &&
|
||||
+ (errno != EEXIST)) {
|
||||
xf86Msg(X_ERROR, "%s can't create repeater fifo\n", local->name);
|
||||
} else {
|
||||
/* open the repeater fifo */
|
||||
@@ -447,7 +455,7 @@
|
||||
xf86Msg(X_ERROR, "%s repeater device open failed\n", local->name);
|
||||
}
|
||||
}
|
||||
- xf86free(repeater);
|
||||
+ free(repeater);
|
||||
}
|
||||
|
||||
if (!QueryHardware(local)) {
|
||||
@@ -634,7 +642,7 @@
|
||||
static int
|
||||
move_distance(int dx, int dy)
|
||||
{
|
||||
- return xf86sqrt(SQR(dx) + SQR(dy));
|
||||
+ return sqrt(SQR(dx) + SQR(dy));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -669,14 +677,14 @@
|
||||
double xCenter = (priv->synpara->left_edge + priv->synpara->right_edge) / 2.0;
|
||||
double yCenter = (priv->synpara->top_edge + priv->synpara->bottom_edge) / 2.0;
|
||||
|
||||
- return xf86atan2(-(y - yCenter), x - xCenter);
|
||||
+ return atan2(-(y - yCenter), x - xCenter);
|
||||
}
|
||||
|
||||
/* return angle difference */
|
||||
static double
|
||||
diffa(double a1, double a2)
|
||||
{
|
||||
- double da = xf86fmod(a2 - a1, 2 * M_PI);
|
||||
+ double da = fmod(a2 - a1, 2 * M_PI);
|
||||
if (da < 0)
|
||||
da += 2 * M_PI;
|
||||
if (da > M_PI)
|
||||
@@ -784,7 +792,7 @@
|
||||
int c;
|
||||
while ((c = XisbRead(priv->comm.buffer)) >= 0) {
|
||||
unsigned char u = (unsigned char)c;
|
||||
- xf86write(priv->fifofd, &u, 1);
|
||||
+ write(priv->fifofd, &u, 1);
|
||||
if (++count >= 3)
|
||||
break;
|
||||
}
|
||||
@@ -1280,10 +1288,10 @@
|
||||
|
||||
/* save the fraction, report the integer part */
|
||||
tmpf = dx * speed + x_edge_speed * dtime + priv->frac_x;
|
||||
- priv->frac_x = xf86modf(tmpf, &integral);
|
||||
+ priv->frac_x = modf(tmpf, &integral);
|
||||
dx = integral;
|
||||
tmpf = dy * speed + y_edge_speed * dtime + priv->frac_y;
|
||||
- priv->frac_y = xf86modf(tmpf, &integral);
|
||||
+ priv->frac_y = modf(tmpf, &integral);
|
||||
dy = integral;
|
||||
}
|
||||
|
||||
16
x11-drivers/synaptics/files/synaptics-fix-xinerama.patch
Normal file
16
x11-drivers/synaptics/files/synaptics-fix-xinerama.patch
Normal file
@@ -0,0 +1,16 @@
|
||||
--- synaptics-0.14.6.orig/synaptics.c 2008-01-18 23:32:59.000000000 -0500
|
||||
+++ synaptics-0.14.6/synaptics.c 2008-01-18 23:32:15.000000000 -0500
|
||||
@@ -617,10 +617,10 @@
|
||||
miPointerGetMotionBufferSize());
|
||||
|
||||
/* X valuator */
|
||||
- xf86InitValuatorAxisStruct(dev, 0, 0, -1, 1, 0, 1);
|
||||
+ xf86InitValuatorAxisStruct(dev, 0, -1, -1, 1, 0, 1);
|
||||
xf86InitValuatorDefaults(dev, 0);
|
||||
/* Y valuator */
|
||||
- xf86InitValuatorAxisStruct(dev, 1, 0, -1, 1, 0, 1);
|
||||
+ xf86InitValuatorAxisStruct(dev, 1, -1, -1, 1, 0, 1);
|
||||
xf86InitValuatorDefaults(dev, 1);
|
||||
|
||||
xf86MotionHistoryAllocate(local);
|
||||
|
||||
83
x11-drivers/synaptics/files/synaptics-fixeventgrab.diff
Normal file
83
x11-drivers/synaptics/files/synaptics-fixeventgrab.diff
Normal file
@@ -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,
|
||||
11
x11-drivers/synaptics/files/synaptics-install-so-exec.patch
Normal file
11
x11-drivers/synaptics/files/synaptics-install-so-exec.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
--- synaptics-0.14.6/Makefile.orig 2008-04-01 16:10:04.000000000 -0400
|
||||
+++ synaptics-0.14.6/Makefile 2008-04-01 16:10:23.000000000 -0400
|
||||
@@ -115,7 +115,7 @@
|
||||
install -D $< $@
|
||||
|
||||
$(INPUT_MODULE_DIR)/$(SYNAPTICS_DRV) : $(SYNAPTICS_DRV)
|
||||
- install --mode=0644 -D $< $@
|
||||
+ install --mode=0755 -D $< $@
|
||||
|
||||
$(SYNAPTICS_DRV): $(OBJS)
|
||||
$(RM) $@
|
||||
62
x11-drivers/synaptics/files/synaptics_input_api.diff
Normal file
62
x11-drivers/synaptics/files/synaptics_input_api.diff
Normal file
@@ -0,0 +1,62 @@
|
||||
diff -u synaptics-0.14.6.orig/Makefile synaptics-0.14.6/Makefile
|
||||
--- synaptics-0.14.6.orig/Makefile 2006-07-15 17:58:26.000000000 +0200
|
||||
+++ synaptics-0.14.6/Makefile 2007-09-07 15:03:17.386179198 +0200
|
||||
@@ -34,10 +34,9 @@
|
||||
LDCOMBINEFLAGS = -shared -lc
|
||||
PICFLAG = $(call check_gcc,-fPIC,)
|
||||
X_INCLUDES_ROOT = $(INSTALLED_X)
|
||||
- SDKDIR = $(shell pkg-config xorg-server --variable=sdkdir)
|
||||
ALLINCLUDES = -I. -I$(INSTALLED_X)/include/X11 \
|
||||
-I$(INSTALLED_X)/include/X11/extensions \
|
||||
- -I$(SDKDIR)
|
||||
+ `pkg-config xorg-server --cflags`
|
||||
else
|
||||
INSTALLED_X = /usr/X11R6
|
||||
INPUT_MODULE_DIR = $(DESTDIR)/$(INSTALLED_X)/$(LIBDIR)/modules/input
|
||||
diff -u 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 2007-09-07 15:10:24.910542275 +0200
|
||||
@@ -321,7 +321,9 @@
|
||||
local->private_flags = 0;
|
||||
local->flags = XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS;
|
||||
local->conf_idev = dev;
|
||||
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
|
||||
local->motion_history_proc = xf86GetMotionEvents;
|
||||
+#endif
|
||||
local->history_size = 0;
|
||||
local->always_core_feedback = 0;
|
||||
|
||||
@@ -613,8 +615,17 @@
|
||||
|
||||
InitPointerDeviceStruct((DevicePtr)dev, map,
|
||||
SYN_MAX_BUTTONS,
|
||||
- miPointerGetMotionEvents, SynapticsCtrl,
|
||||
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
|
||||
+ miPointerGetMotionEvents,
|
||||
+#else
|
||||
+ GetMotionHistory,
|
||||
+#endif
|
||||
+ SynapticsCtrl,
|
||||
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
|
||||
miPointerGetMotionBufferSize());
|
||||
+#else
|
||||
+ GetMotionHistorySize(), 2);
|
||||
+#endif
|
||||
|
||||
/* X valuator */
|
||||
xf86InitValuatorAxisStruct(dev, 0, 0, -1, 1, 0, 1);
|
||||
diff -u synaptics-0.14.6.orig/synaptics.h synaptics-0.14.6/synaptics.h
|
||||
--- synaptics-0.14.6.orig/synaptics.h 2006-07-15 17:54:29.000000000 +0200
|
||||
+++ synaptics-0.14.6/synaptics.h 2007-09-07 15:10:12.409829887 +0200
|
||||
@@ -226,5 +226,11 @@
|
||||
|
||||
#endif /* SYNAPTICS_PRIVATE */
|
||||
|
||||
+/* Previously found in xf86Xinput.h */
|
||||
+#ifdef DBG
|
||||
+#undef DBG
|
||||
+#endif
|
||||
+
|
||||
+#define DBG(lvl, f) {if ((lvl) <= xf86GetVerbosity()) f;}
|
||||
|
||||
#endif /* _SYNAPTICS_H_ */
|
||||
Reference in New Issue
Block a user