Gentoo Archives: gentoo-commits

From: "Rene Nussbaumer (killerfox)" <killerfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-drivers/synaptics/files: synaptics-fixeventgrab.diff digest-synaptics-0.14.6-r1
Date: Fri, 11 Jan 2008 19:57:52
Message-Id: E1JDQ0i-0007x1-My@stork.gentoo.org
1 killerfox 08/01/11 19:57:48
2
3 Added: synaptics-fixeventgrab.diff
4 digest-synaptics-0.14.6-r1
5 Log:
6 Revision bump fixing event device grabbing.
7 (Portage version: 2.1.3.19)
8
9 Revision Changes Path
10 1.1 x11-drivers/synaptics/files/synaptics-fixeventgrab.diff
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/synaptics/files/synaptics-fixeventgrab.diff?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/synaptics/files/synaptics-fixeventgrab.diff?rev=1.1&content-type=text/plain
14
15 Index: synaptics-fixeventgrab.diff
16 ===================================================================
17 diff -urN synaptics-0.14.6.orig/eventcomm.c synaptics-0.14.6/eventcomm.c
18 --- synaptics-0.14.6.orig/eventcomm.c 2006-07-15 17:54:29.000000000 +0200
19 +++ synaptics-0.14.6/eventcomm.c 2008-01-06 23:44:09.000000000 +0100
20 @@ -40,16 +40,24 @@
21 * Function Definitions
22 ****************************************************************************/
23
24 -static void
25 +static Bool
26 +grab_event_device(int fd)
27 +{
28 + int ret;
29 + SYSCALL(ret = ioctl(fd, EVIOCGRAB, (pointer)1));
30 + return !(ret < 0);
31 +}
32 +
33 +static Bool
34 EventDeviceOnHook(LocalDevicePtr local)
35 {
36 /* Try to grab the event device so that data don't leak to /dev/input/mice */
37 - int ret;
38 - SYSCALL(ret = ioctl(local->fd, EVIOCGRAB, (pointer)1));
39 - if (ret < 0) {
40 + if(!grab_event_device(local->fd)) {
41 xf86Msg(X_WARNING, "%s can't grab event device, errno=%d\n",
42 local->name, errno);
43 + return FALSE;
44 }
45 + return TRUE;
46 }
47
48 static void
49 @@ -247,6 +255,7 @@
50 char fname[64];
51 int fd = -1;
52 Bool is_touchpad;
53 + Bool is_grabbable;
54
55 sprintf(fname, "%s/%s%d", DEV_INPUT_EVENT, EVENT_DEV_NAME, i);
56 SYSCALL(fd = open(fname, O_RDONLY));
57 @@ -263,8 +272,16 @@
58 noent_cnt = 0;
59 have_evdev = TRUE;
60 is_touchpad = event_query_is_touchpad(fd);
61 + /**
62 + * Check whether device can be grabbed. This means there is a race
63 + * condition with EventDeviceOnHook, which can't be solved cleanly
64 + * the way things are done with the current design. One possible
65 + * solution would be to keep the file descriptor open.
66 + */
67 + is_grabbable = grab_event_device(fd);
68 +
69 SYSCALL(close(fd));
70 - if (is_touchpad) {
71 + if (is_touchpad && is_grabbable) {
72 xf86Msg(X_PROBED, "%s auto-dev sets device to %s\n",
73 local->name, fname);
74 xf86ReplaceStrOption(local->options, "Device", fname);
75 diff -urN synaptics-0.14.6.orig/synaptics.c synaptics-0.14.6/synaptics.c
76 --- synaptics-0.14.6.orig/synaptics.c 2006-07-15 17:54:29.000000000 +0200
77 +++ synaptics-0.14.6/synaptics.c 2008-01-06 23:03:26.000000000 +0100
78 @@ -543,7 +543,8 @@
79 return !Success;
80 }
81
82 - priv->proto_ops->DeviceOnHook(local);
83 + if(!priv->proto_ops->DeviceOnHook(local))
84 + return !Success;
85
86 priv->comm.buffer = XisbNew(local->fd, 64);
87 if (!priv->comm.buffer) {
88 diff -urN synaptics-0.14.6.orig/synproto.h synaptics-0.14.6/synproto.h
89 --- synaptics-0.14.6.orig/synproto.h 2006-07-09 18:53:02.000000000 +0200
90 +++ synaptics-0.14.6/synproto.h 2008-01-06 22:31:19.000000000 +0100
91 @@ -76,7 +76,7 @@
92 struct CommData;
93
94 struct SynapticsProtocolOperations {
95 - void (*DeviceOnHook)(LocalDevicePtr local);
96 + Bool (*DeviceOnHook)(LocalDevicePtr local);
97 void (*DeviceOffHook)(LocalDevicePtr local);
98 Bool (*QueryHardware)(LocalDevicePtr local, struct SynapticsHwInfo *synhw);
99 Bool (*ReadHwState)(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
100
101
102
103 1.1 x11-drivers/synaptics/files/digest-synaptics-0.14.6-r1
104
105 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/synaptics/files/digest-synaptics-0.14.6-r1?rev=1.1&view=markup
106 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/synaptics/files/digest-synaptics-0.14.6-r1?rev=1.1&content-type=text/plain
107
108 Index: digest-synaptics-0.14.6-r1
109 ===================================================================
110 MD5 1102cd575045640a064ab6f9b1e391af synaptics-0.14.6.tar.bz2 126833
111 RMD160 7a8b103aa314eb13dc512c663c501108cc24a574 synaptics-0.14.6.tar.bz2 126833
112 SHA256 f88b967258a0484b0aa02f26acfb31a70cc8afd4872608b7f81c44dc29ae8429 synaptics-0.14.6.tar.bz2 126833
113
114
115
116 --
117 gentoo-commits@l.g.o mailing list