Skip to content

Commit 5947c79

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 5947c79

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

xf86-input-mfndev/src/qubes.c

Lines changed: 6 additions & 6 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

@@ -364,18 +364,18 @@ static int _qubes_init_axes(DeviceIntPtr device)
364364
return BadAlloc;
365365

366366
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
367-
pInfo->dev->valuator->mode = Relative;
367+
pInfo->dev->valuator->mode = Absolute;
368368
#endif
369369
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 13
370370
if (!InitAbsoluteClassDeviceStruct(device))
371371
return BadAlloc;
372372
#endif
373373

374374
for (i = 0; i < pQubes->axes; i++) {
375-
xf86InitValuatorAxisStruct(device, i, *pQubes->labels, -1,
376-
-1, 1, 1, 1
375+
xf86InitValuatorAxisStruct(device, i, atoms[i], 0,
376+
32767, 1, 1, 1
377377
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
378-
, Relative
378+
, Absolute
379379
#endif
380380
);
381381
xf86InitValuatorDefaults(device, i);

0 commit comments

Comments
 (0)