1 |
calchan 08/08/29 20:01:50 |
2 |
|
3 |
Added: synaptics-0.14.6_p20070706-input_api.patch |
4 |
synaptics-0.14.6_p20070706-fixeventgrab.patch |
5 |
Log: |
6 |
Last snapshot before switching to the new driver (x11-drivers/xf86-input-synaptics) with the new xorg. |
7 |
(Portage version: 2.2_rc8/cvs/Linux 2.6.26-gentoo-r1 i686) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-input_api.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-input_api.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-input_api.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: synaptics-0.14.6_p20070706-input_api.patch |
16 |
=================================================================== |
17 |
diff -urN synaptics-0.14.6_p20070706.orig/Makefile synaptics-0.14.6_p20070706/Makefile |
18 |
--- synaptics-0.14.6_p20070706.orig/Makefile 2008-08-29 09:34:11.000000000 +0200 |
19 |
+++ synaptics-0.14.6_p20070706/Makefile 2008-08-29 10:40:29.000000000 +0200 |
20 |
@@ -34,10 +34,9 @@ |
21 |
LDCOMBINEFLAGS = -shared -lc |
22 |
PICFLAG = $(call check_gcc,-fPIC,) |
23 |
X_INCLUDES_ROOT = $(INSTALLED_X) |
24 |
- SDKDIR = $(shell pkg-config xorg-server --variable=sdkdir) |
25 |
ALLINCLUDES = -I. -I$(INSTALLED_X)/include/X11 \ |
26 |
-I$(INSTALLED_X)/include/X11/extensions \ |
27 |
- -I$(SDKDIR) |
28 |
+ `pkg-config xorg-server --cflags` |
29 |
else |
30 |
INSTALLED_X = /usr/X11R6 |
31 |
INPUT_MODULE_DIR = $(DESTDIR)/$(INSTALLED_X)/$(LIBDIR)/modules/input |
32 |
|
33 |
|
34 |
|
35 |
1.1 x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-fixeventgrab.patch |
36 |
|
37 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-fixeventgrab.patch?rev=1.1&view=markup |
38 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-fixeventgrab.patch?rev=1.1&content-type=text/plain |
39 |
|
40 |
Index: synaptics-0.14.6_p20070706-fixeventgrab.patch |
41 |
=================================================================== |
42 |
diff -urN synaptics-0.14.6_p20070706.orig/eventcomm.c synaptics-0.14.6_p20070706/eventcomm.c |
43 |
--- synaptics-0.14.6_p20070706.orig/eventcomm.c 2008-08-29 09:34:11.000000000 +0200 |
44 |
+++ synaptics-0.14.6_p20070706/eventcomm.c 2008-08-29 10:23:04.000000000 +0200 |
45 |
@@ -41,17 +41,25 @@ |
46 |
* Function Definitions |
47 |
****************************************************************************/ |
48 |
|
49 |
-static void |
50 |
+static Bool |
51 |
+grab_event_device(int fd) |
52 |
+{ |
53 |
+ int ret; |
54 |
+ SYSCALL(ret = ioctl(fd, EVIOCGRAB, (pointer)1)); |
55 |
+ return !(ret < 0); |
56 |
+} |
57 |
+ |
58 |
+static Bool |
59 |
EventDeviceOnHook(LocalDevicePtr local, SynapticsSHM *para) |
60 |
{ |
61 |
if (para->grab_event_device) { |
62 |
/* Try to grab the event device so that data don't leak to /dev/input/mice */ |
63 |
- int ret; |
64 |
- SYSCALL(ret = ioctl(local->fd, EVIOCGRAB, (pointer)1)); |
65 |
- if (ret < 0) { |
66 |
+ if(!grab_event_device(local->fd)) { |
67 |
xf86Msg(X_WARNING, "%s can't grab event device, errno=%d\n", |
68 |
local->name, errno); |
69 |
+ return FALSE; |
70 |
} |
71 |
+ return TRUE; |
72 |
} |
73 |
} |
74 |
|
75 |
@@ -273,6 +281,7 @@ |
76 |
char fname[64]; |
77 |
int fd = -1; |
78 |
Bool is_touchpad; |
79 |
+ Bool is_grabbable; |
80 |
|
81 |
sprintf(fname, "%s/%s%d", DEV_INPUT_EVENT, EVENT_DEV_NAME, i); |
82 |
SYSCALL(fd = open(fname, O_RDONLY)); |
83 |
@@ -289,7 +298,14 @@ |
84 |
noent_cnt = 0; |
85 |
have_evdev = TRUE; |
86 |
is_touchpad = event_query_is_touchpad(fd); |
87 |
- if (is_touchpad) { |
88 |
+ /** |
89 |
+ * Check whether device can be grabbed. This means there is a race |
90 |
+ * condition with EventDeviceOnHook, which can't be solved cleanly |
91 |
+ * the way things are done with the current design. One possible |
92 |
+ * solution would be to keep the file descriptor open. |
93 |
+ */ |
94 |
+ is_grabbable = grab_event_device(fd); |
95 |
+ if (is_touchpad && is_grabbable) { |
96 |
xf86Msg(X_PROBED, "%s auto-dev sets device to %s\n", |
97 |
local->name, fname); |
98 |
xf86ReplaceStrOption(local->options, "Device", fname); |
99 |
diff -urN synaptics-0.14.6_p20070706.orig/synaptics.c synaptics-0.14.6_p20070706/synaptics.c |
100 |
--- synaptics-0.14.6_p20070706.orig/synaptics.c 2008-08-29 09:34:11.000000000 +0200 |
101 |
+++ synaptics-0.14.6_p20070706/synaptics.c 2008-08-29 10:26:01.000000000 +0200 |
102 |
@@ -595,7 +595,8 @@ |
103 |
return !Success; |
104 |
} |
105 |
|
106 |
- priv->proto_ops->DeviceOnHook(local, priv->synpara); |
107 |
+ if(!priv->proto_ops->DeviceOnHook(local, priv->synpara)) |
108 |
+ return !Success; |
109 |
|
110 |
priv->comm.buffer = XisbNew(local->fd, 64); |
111 |
if (!priv->comm.buffer) { |
112 |
diff -urN synaptics-0.14.6_p20070706.orig/synproto.h synaptics-0.14.6_p20070706/synproto.h |
113 |
--- synaptics-0.14.6_p20070706.orig/synproto.h 2008-08-29 09:34:11.000000000 +0200 |
114 |
+++ synaptics-0.14.6_p20070706/synproto.h 2008-08-29 10:28:34.000000000 +0200 |
115 |
@@ -77,7 +77,7 @@ |
116 |
struct CommData; |
117 |
|
118 |
struct SynapticsProtocolOperations { |
119 |
- void (*DeviceOnHook)(LocalDevicePtr local, struct _SynapticsSHM *para); |
120 |
+ Bool (*DeviceOnHook)(LocalDevicePtr local, struct _SynapticsSHM *para); |
121 |
void (*DeviceOffHook)(LocalDevicePtr local); |
122 |
Bool (*QueryHardware)(LocalDevicePtr local, struct SynapticsHwInfo *synhw); |
123 |
Bool (*ReadHwState)(LocalDevicePtr local, struct SynapticsHwInfo *synhw, |