summaryrefslogtreecommitdiff
path: root/src/evdev-tablet.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-12-21 12:53:00 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-01-11 15:17:46 +1000
commitd51c8f94205780d15154e7aac72cc34a251ebe3f (patch)
treea340559edc36a81fc9eb74d2f2d5cdd42ab7d25f /src/evdev-tablet.c
parenta28c198e2a44bea044c352c2c5b629e7510318da (diff)
tablet: always set the pressure offset
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
Diffstat (limited to 'src/evdev-tablet.c')
-rw-r--r--src/evdev-tablet.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index 6ca2c18..f1b22f1 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -881,6 +881,8 @@ tablet_get_tool(struct tablet_dispatch *tablet,
/* If we didn't already have the new_tool in our list of tools,
* add it */
if (!tool) {
+ const struct input_absinfo *pressure;
+
tool = zalloc(sizeof *tool);
*tool = (struct libinput_tablet_tool) {
.type = type,
@@ -891,6 +893,12 @@ tablet_get_tool(struct tablet_dispatch *tablet,
tool->pressure_offset = 0;
tool->has_pressure_offset = false;
+
+ pressure = libevdev_get_abs_info(tablet->device->evdev,
+ ABS_PRESSURE);
+ if (pressure)
+ tool->pressure_offset = pressure->minimum;
+
tool_set_bits(tablet, tool);
list_insert(tool_list, &tool->link);