@@ -216,11 +216,21 @@ static void init_button_labels(Atom *labels, size_t size)
216
216
labels [10 ] = XIGetKnownProperty (BTN_LABEL_PROP_BTN_BACK );
217
217
}
218
218
219
+ static void init_axis_labels (Atom * labels , size_t size )
220
+ {
221
+ assert (size >= 2 );
222
+
223
+ memset (labels , 0 , size * sizeof (Atom ));
224
+ labels [0 ] = XIGetKnownProperty (AXIS_LABEL_PROP_ABS_MT_POSITION_X );
225
+ labels [1 ] = XIGetKnownProperty (AXIS_LABEL_PROP_ABS_MT_POSITION_Y );
226
+ }
227
+
219
228
static int xf86TslibControlProc (DeviceIntPtr device , int what )
220
229
{
221
230
InputInfoPtr pInfo ;
222
231
unsigned char map [MAXBUTTONS + 1 ];
223
232
Atom labels [MAXBUTTONS ];
233
+ Atom axis_labels [2 ];
224
234
int i , axiswidth , axisheight ;
225
235
struct ts_priv * priv ;
226
236
@@ -239,6 +249,7 @@ static int xf86TslibControlProc(DeviceIntPtr device, int what)
239
249
map [i + 1 ] = i + 1 ;
240
250
241
251
init_button_labels (labels , ARRAY_SIZE (labels ));
252
+ init_axis_labels (axis_labels , ARRAY_SIZE (axis_labels ));
242
253
243
254
if (InitButtonClassDeviceStruct (device ,
244
255
MAXBUTTONS ,
@@ -251,7 +262,7 @@ static int xf86TslibControlProc(DeviceIntPtr device, int what)
251
262
252
263
if (InitValuatorClassDeviceStruct (device ,
253
264
2 ,
254
- labels ,
265
+ axis_labels ,
255
266
0 , Absolute ) == FALSE) {
256
267
xf86IDrvMsg (pInfo , X_ERROR ,
257
268
"unable to allocate Valuator class device\n" );
0 commit comments