|
|
@ -229,6 +229,21 @@ is_motion_event(struct input_event *e) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
|
|
|
transform_absolute(struct evdev_device *device) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (!device->abs.apply_calibration) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
device->abs.x = device->abs.x * device->abs.calibration[0] + |
|
|
|
|
|
|
|
device->abs.y * device->abs.calibration[1] + |
|
|
|
|
|
|
|
device->abs.calibration[2]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
device->abs.y = device->abs.x * device->abs.calibration[3] + |
|
|
|
|
|
|
|
device->abs.y * device->abs.calibration[4] + |
|
|
|
|
|
|
|
device->abs.calibration[5]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
static void |
|
|
|
evdev_flush_motion(struct evdev_device *device, uint32_t time) |
|
|
|
evdev_flush_motion(struct evdev_device *device, uint32_t time) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -269,6 +284,7 @@ evdev_flush_motion(struct evdev_device *device, uint32_t time) |
|
|
|
device->pending_events &= ~EVDEV_ABSOLUTE_MT_UP; |
|
|
|
device->pending_events &= ~EVDEV_ABSOLUTE_MT_UP; |
|
|
|
} |
|
|
|
} |
|
|
|
if (device->pending_events & EVDEV_ABSOLUTE_MOTION) { |
|
|
|
if (device->pending_events & EVDEV_ABSOLUTE_MOTION) { |
|
|
|
|
|
|
|
transform_absolute(device); |
|
|
|
notify_motion(master, time, |
|
|
|
notify_motion(master, time, |
|
|
|
wl_fixed_from_int(device->abs.x), |
|
|
|
wl_fixed_from_int(device->abs.x), |
|
|
|
wl_fixed_from_int(device->abs.y)); |
|
|
|
wl_fixed_from_int(device->abs.y)); |
|
|
|