aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-graphics/xorg-driver/xf86-input-mtev/fix-it.patch
blob: 771a2a8e129bcd9e74ac5834bea01886aedbb8a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
diff --git a/src/multitouch.c b/src/multitouch.c
index c55d742..4a8192d 100644
--- a/src/multitouch.c
+++ b/src/multitouch.c
@@ -114,7 +114,7 @@ static int init_properties(DeviceIntPtr dev)
 	return Success;
 }
 
-static int device_init(DeviceIntPtr dev, LocalDevicePtr local)
+static int device_init(DeviceIntPtr dev, InputInfoPtr local)
 {
 	struct mtev_mtouch *mt = local->private;
 	Atom atom;
@@ -222,7 +222,7 @@ static int device_init(DeviceIntPtr dev, LocalDevicePtr local)
 			xf86InitValuatorAxisStruct(dev, val, axes_labels[val],
 						   min,
 						   max,
-						   1, 0, 1);
+						   1, 0, 1,Absolute);
 			xf86InitValuatorDefaults(dev, val);
 		}
 	}
@@ -232,7 +232,7 @@ static int device_init(DeviceIntPtr dev, LocalDevicePtr local)
 	return Success;
 }
 
-static int device_on(LocalDevicePtr local)
+static int device_on(InputInfoPtr local)
 {
 	struct mtev_mtouch *mt = local->private;
 	local->fd = xf86OpenSerial(local->options);
@@ -248,7 +248,7 @@ static int device_on(LocalDevicePtr local)
 	return Success;
 }
 
-static int device_off(LocalDevicePtr local)
+static int device_off(InputInfoPtr local)
 {
 	struct mtev_mtouch *mt = local->private;
 	xf86RemoveEnabledDevice(local);
@@ -259,12 +259,12 @@ static int device_off(LocalDevicePtr local)
 	return Success;
 }
 
-static int device_close(LocalDevicePtr local)
+static int device_close(InputInfoPtr local)
 {
 	return Success;
 }
 
-static void process_state(LocalDevicePtr local,
+static void process_state(InputInfoPtr local,
 			  const struct mtev_mtouch *mt)
 {
 
@@ -321,22 +321,22 @@ static void process_state(LocalDevicePtr local,
 	}
 
 	/* Some x-clients assume they get motion events before button down */
+	xf86Msg(X_INFO,"down %d|pdown %d\n", down, pdown);
 	if (down)
 		xf86PostMotionEventP(local->dev, TRUE,
 				     0, down * MT_AXIS_PER_FINGER, valuators);
-
 	if(down && pdown == 0)
 		xf86PostButtonEventP(local->dev, TRUE,
 				     1, 1,
 				     0, down * MT_AXIS_PER_FINGER, valuators);
-	else if (down == 0 && pdown)
-		xf86PostButtonEvent(local->dev, TRUE, 1, 0, 0, 0);
-
+	else if (down == 0 && pdown){
+		xf86PostButtonEvent(local->dev, TRUE, 1, 1, 0, 0);
+	}
 	pdown = !!down;
 }
 
 /* called for each full received packet from the touchpad */
-static void read_input(LocalDevicePtr local)
+static void read_input(InputInfoPtr local)
 {
 	struct mtev_mtouch *mt = local->private;
 	while (mtouch_read_synchronized_event(mt, local->fd)) {
@@ -346,7 +346,7 @@ static void read_input(LocalDevicePtr local)
 
 static Bool device_control(DeviceIntPtr dev, int mode)
 {
-	LocalDevicePtr local = dev->public.devicePrivate;
+	InputInfoPtr local = dev->public.devicePrivate;
 	switch (mode) {
 	case DEVICE_INIT:
 		xf86Msg(X_INFO, "device control: init\n");
@@ -366,39 +366,29 @@ static Bool device_control(DeviceIntPtr dev, int mode)
 	}
 }
 
-static InputInfoPtr preinit(InputDriverPtr drv, IDevPtr dev, int flags)
+static InputInfoPtr preinit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
 {
 	struct mtev_mtouch *mt;
-	InputInfoPtr local = xf86AllocateInput(drv, 0);
-	if (!local)
-		goto error;
+	int rc;
+
 	mt = calloc(1, sizeof(struct mtev_mtouch));
+
 	if (!mt)
 		goto error;
 
-	local->name = dev->identifier;
-	local->type_name = XI_TOUCHSCREEN;
-	local->device_control = device_control;
-	local->read_input = read_input;
-	local->private = mt;
-	local->flags = XI86_POINTER_CAPABLE |
-		XI86_SEND_DRAG_EVENTS;
-
-	local->conf_idev = dev;
-
-	xf86CollectInputOptions(local, NULL, NULL);
-	//xf86OptionListReport(local->options);
-	xf86ProcessCommonOptions(local, local->options);
+	pInfo->private = mt;
+	pInfo->type_name = "UNKNOWN";
+	pInfo->device_control = device_control;
+	pInfo->read_input = read_input;
 
+	mt->swap_xy = xf86SetBoolOption(pInfo->options, "SwapAxes", FALSE);
+	mt->invert_x = xf86SetBoolOption(pInfo->options, "InvertX", FALSE);
+	mt->invert_y = xf86SetBoolOption(pInfo->options, "InvertY", FALSE);
 
-	mt->swap_xy = xf86SetBoolOption(local->options, "SwapAxes", FALSE);
-	mt->invert_x = xf86SetBoolOption(local->options, "InvertX", FALSE);
-	mt->invert_y = xf86SetBoolOption(local->options, "InvertY", FALSE);
-
-	local->flags |= XI86_CONFIGURED;
+	return Success;
 
 error:
-	return local;
+	return !Success;
 }
 
 static void uninit(InputDriverPtr drv, InputInfoPtr local, int flags)
@@ -415,7 +405,6 @@ static InputDriverRec MTEV = {
 	.PreInit = preinit,
 	.UnInit = uninit,
 	.module = NULL,
-	.refCount = 0
 };
 
 static XF86ModuleVersionInfo VERSION = {