Skip to content

Commit

Permalink
Use ABS_MT_TOUCH_MAJOR even without ABS_MT_TOUCH_MINOR
Browse files Browse the repository at this point in the history
The kernel allows the latter to be omitted "if the contact is circular",
so copy the data from the former if available.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  • Loading branch information
jigpu authored and whot committed Oct 28, 2014
1 parent 41895ea commit c65c8bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/mtview.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,11 @@ static void output_touch(const struct touch_info *touch_info,
minor = DEFAULT_WIDTH_MULTIPLIER * t->data[ABS_MT_PRESSURE] * dx;
angle = 0;
}
if (touch_info->has_touch_major && touch_info->has_touch_minor) {
major = t->data[ABS_MT_TOUCH_MAJOR];
minor = t->data[ABS_MT_TOUCH_MINOR];

if (touch_info->has_touch_major) {
major = minor = t->data[ABS_MT_TOUCH_MAJOR];
if (touch_info->has_touch_minor)
minor = t->data[ABS_MT_TOUCH_MINOR];
angle = t->data[ABS_MT_ORIENTATION];
}
if (major == 0 && minor == 0) {
Expand Down

0 comments on commit c65c8bc

Please sign in to comment.