@@ -219,15 +219,6 @@ static void init_button_labels(Atom *labels, size_t size)
219
219
labels [10 ] = XIGetKnownProperty (BTN_LABEL_PROP_BTN_BACK );
220
220
}
221
221
222
- static void init_axis_labels (Atom * labels , size_t size )
223
- {
224
- assert (size >= TOUCH_NUM_AXES );
225
-
226
- memset (labels , 0 , size * sizeof (Atom ));
227
- labels [0 ] = XIGetKnownProperty (AXIS_LABEL_PROP_ABS_MT_POSITION_X );
228
- labels [1 ] = XIGetKnownProperty (AXIS_LABEL_PROP_ABS_MT_POSITION_Y );
229
- }
230
-
231
222
static int xf86TslibControlProc (DeviceIntPtr device , int what )
232
223
{
233
224
InputInfoPtr pInfo ;
@@ -252,7 +243,18 @@ static int xf86TslibControlProc(DeviceIntPtr device, int what)
252
243
map [i + 1 ] = i + 1 ;
253
244
254
245
init_button_labels (labels , ARRAY_SIZE (labels ));
255
- init_axis_labels (axis_labels , ARRAY_SIZE (axis_labels ));
246
+
247
+ /* init axis labels */
248
+ memset (axis_labels , 0 , ARRAY_SIZE (axis_labels ) * sizeof (Atom ));
249
+ if (priv -> abs_x_only ) {
250
+ labels [0 ] = XIGetKnownProperty (AXIS_LABEL_PROP_ABS_X );
251
+ labels [1 ] = XIGetKnownProperty (AXIS_LABEL_PROP_ABS_Y );
252
+ labels [2 ] = XIGetKnownProperty (AXIS_LABEL_PROP_ABS_PRESSURE );
253
+ } else {
254
+ labels [0 ] = XIGetKnownProperty (AXIS_LABEL_PROP_ABS_MT_POSITION_X );
255
+ labels [1 ] = XIGetKnownProperty (AXIS_LABEL_PROP_ABS_MT_POSITION_Y );
256
+ labels [2 ] = XIGetKnownProperty (AXIS_LABEL_PROP_ABS_MT_PRESSURE );
257
+ }
256
258
257
259
if (InitButtonClassDeviceStruct (device ,
258
260
MAXBUTTONS ,
0 commit comments