AttrPointingStickIntegration=internal|external
Indicates the integration of the pointing stick. This is a string enum.
Only needed for external pointing sticks. These are rare.
+AttrTabletSmoothing=1|0
+ Enables (1) or disables (0) input smoothing for tablet devices. Smoothing is enabled
+ by default, except on AES devices.
tablet_change_to_left_handed);
}
-static void
-tablet_init_smoothing(struct evdev_device *device,
- struct tablet_dispatch *tablet)
+static bool
+tablet_is_aes(struct evdev_device *device,
+ struct tablet_dispatch *tablet)
{
- size_t history_size = ARRAY_LENGTH(tablet->history.samples);
+ bool is_aes = false;
#if HAVE_LIBWACOM
const char *devnode;
WacomDeviceDatabase *db;
WacomDevice *libwacom_device = NULL;
const int *stylus_ids;
int nstyli;
- bool is_aes = false;
int vid = evdev_device_get_id_vendor(device);
/* Wacom-specific check for whether smoothing is required:
}
}
- if (is_aes)
- history_size = 1;
-
libwacom_destroy(libwacom_device);
+
out:
#endif
+ return is_aes;
+}
+
+static void
+tablet_init_smoothing(struct evdev_device *device,
+ struct tablet_dispatch *tablet)
+{
+ size_t history_size = ARRAY_LENGTH(tablet->history.samples);
+ struct quirks_context *quirks = NULL;
+ struct quirks *q = NULL;
+ bool use_smoothing = true;
+
+ quirks = evdev_libinput_context(device)->quirks;
+ q = quirks_fetch_for_device(quirks, device->udev_device);
+
+ /* By default, always enable smoothing except on AES devices.
+ * AttrTabletSmoothing can override this, if necessary.
+ */
+ if (!q || !quirks_get_bool(q, QUIRK_ATTR_TABLET_SMOOTHING, &use_smoothing))
+ use_smoothing = !tablet_is_aes(device, tablet);
+
+ /* Setting the history size to 1 means we never do any actual smoothing. */
+ if (!use_smoothing)
+ history_size = 1;
+
+ quirks_unref(q);
tablet->history.size = history_size;
}
case QUIRK_ATTR_TRACKPOINT_MULTIPLIER: return "AttrTrackpointMultiplier";
case QUIRK_ATTR_THUMB_PRESSURE_THRESHOLD: return "AttrThumbPressureThreshold";
case QUIRK_ATTR_USE_VELOCITY_AVERAGING: return "AttrUseVelocityAveraging";
+ case QUIRK_ATTR_TABLET_SMOOTHING: return "AttrTabletSmoothing";
case QUIRK_ATTR_THUMB_SIZE_THRESHOLD: return "AttrThumbSizeThreshold";
case QUIRK_ATTR_MSC_TIMESTAMP: return "AttrMscTimestamp";
case QUIRK_ATTR_EVENT_CODE_DISABLE: return "AttrEventCodeDisable";
p->type = PT_BOOL;
p->value.b = b;
rc = true;
+ } else if (streq(key, quirk_get_name(QUIRK_ATTR_TABLET_SMOOTHING))) {
+ p->id = QUIRK_ATTR_TABLET_SMOOTHING;
+ if (streq(value, "1"))
+ b = true;
+ else if (streq(value, "0"))
+ b = false;
+ else
+ goto out;
+ p->type = PT_BOOL;
+ p->value.b = b;
+ rc = true;
} else if (streq(key, quirk_get_name(QUIRK_ATTR_THUMB_PRESSURE_THRESHOLD))) {
p->id = QUIRK_ATTR_THUMB_PRESSURE_THRESHOLD;
if (!safe_atou(value, &v))
QUIRK_ATTR_TRACKPOINT_MULTIPLIER,
QUIRK_ATTR_THUMB_PRESSURE_THRESHOLD,
QUIRK_ATTR_USE_VELOCITY_AVERAGING,
+ QUIRK_ATTR_TABLET_SMOOTHING,
QUIRK_ATTR_THUMB_SIZE_THRESHOLD,
QUIRK_ATTR_MSC_TIMESTAMP,
QUIRK_ATTR_EVENT_CODE_DISABLE,
callback(userdata, buf);
break;
case QUIRK_ATTR_USE_VELOCITY_AVERAGING:
+ case QUIRK_ATTR_TABLET_SMOOTHING:
snprintf(buf, sizeof(buf), "%s=1", name);
callback(userdata, buf);
break;