Skip to content

Commit e391956

Browse files
committed
Correctly label pointing device as absolute, not relative
The input device actually reports absolute events, not relative. Interestingly it worked before, probably because of InitAbsoluteClassDeviceStruct, but some applications were confused about mismatching mode. Adjust also min/max values based on max resolution supported by the qubes dummy driver. Fixes QubesOS/qubes-issues#7316
1 parent 216a615 commit e391956

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

xf86-input-mfndev/src/qubes.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,8 @@ static void QubesInitAxesLabels(QubesDevicePtr pQubes, int natoms,
328328
const char **labels;
329329
int labels_len = 0;
330330

331-
labels = rel_labels;
332-
labels_len = ArrayLength(rel_labels);
331+
labels = abs_labels;
332+
labels_len = ArrayLength(abs_labels);
333333

334334
memset(atoms, 0, natoms * sizeof(Atom));
335335

@@ -360,22 +360,23 @@ static int _qubes_init_axes(DeviceIntPtr device)
360360
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
361361
atoms,
362362
#endif
363-
GetMotionHistorySize(), 0))
363+
GetMotionHistorySize(),
364+
Absolute))
364365
return BadAlloc;
365366

366367
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
367-
pInfo->dev->valuator->mode = Relative;
368+
pInfo->dev->valuator->mode = Absolute;
368369
#endif
369370
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 13
370371
if (!InitAbsoluteClassDeviceStruct(device))
371372
return BadAlloc;
372373
#endif
373374

374375
for (i = 0; i < pQubes->axes; i++) {
375-
xf86InitValuatorAxisStruct(device, i, *pQubes->labels, -1,
376-
-1, 1, 1, 1
376+
xf86InitValuatorAxisStruct(device, i, atoms[i], 0,
377+
32767, 1, 1, 1
377378
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
378-
, Relative
379+
, Absolute
379380
#endif
380381
);
381382
xf86InitValuatorDefaults(device, i);

0 commit comments

Comments
 (0)