|
|
|
|
@@ -461,19 +461,34 @@ xf86libinput_set_area_ratio(struct xf86libinput *driver_data,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* returns true if the device has one or more of the given capabilities or
|
|
|
|
|
* if the device isn't a subdevice
|
|
|
|
|
*/
|
|
|
|
|
static inline bool
|
|
|
|
|
subdevice_has_capabilities(DeviceIntPtr dev, uint32_t capabilities)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
struct xf86libinput *driver_data = pInfo->private;
|
|
|
|
|
|
|
|
|
|
if (!xf86libinput_is_subdevice(pInfo))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
return !!(driver_data->capabilities & capabilities);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
|
|
|
|
|
BOOL checkonly);
|
|
|
|
|
static void
|
|
|
|
|
LibinputInitProperty(DeviceIntPtr dev);
|
|
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
|
LibinputApplyConfig(DeviceIntPtr dev)
|
|
|
|
|
static void
|
|
|
|
|
LibinputApplyConfigSendEvents(DeviceIntPtr dev,
|
|
|
|
|
struct xf86libinput *driver_data,
|
|
|
|
|
struct libinput_device *device)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
struct xf86libinput *driver_data = pInfo->private;
|
|
|
|
|
struct libinput_device *device = driver_data->shared_device->device;
|
|
|
|
|
unsigned int scroll_button;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_send_events_get_modes(device) != LIBINPUT_CONFIG_SEND_EVENTS_ENABLED &&
|
|
|
|
|
libinput_device_config_send_events_set_mode(device,
|
|
|
|
|
@@ -481,6 +496,17 @@ LibinputApplyConfig(DeviceIntPtr dev)
|
|
|
|
|
xf86IDrvMsg(pInfo, X_ERROR,
|
|
|
|
|
"Failed to set SendEventsMode %u\n",
|
|
|
|
|
driver_data->options.sendevents);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
LibinputApplyConfigNaturalScroll(DeviceIntPtr dev,
|
|
|
|
|
struct xf86libinput *driver_data,
|
|
|
|
|
struct libinput_device *device)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_scroll_has_natural_scroll(device) &&
|
|
|
|
|
libinput_device_config_scroll_set_natural_scroll_enabled(device,
|
|
|
|
|
@@ -488,6 +514,17 @@ LibinputApplyConfig(DeviceIntPtr dev)
|
|
|
|
|
xf86IDrvMsg(pInfo, X_ERROR,
|
|
|
|
|
"Failed to set NaturalScrolling to %d\n",
|
|
|
|
|
driver_data->options.natural_scrolling);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
LibinputApplyConfigAccel(DeviceIntPtr dev,
|
|
|
|
|
struct xf86libinput *driver_data,
|
|
|
|
|
struct libinput_device *device)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_accel_is_available(device) &&
|
|
|
|
|
libinput_device_config_accel_set_speed(device,
|
|
|
|
|
@@ -516,6 +553,17 @@ LibinputApplyConfig(DeviceIntPtr dev)
|
|
|
|
|
}
|
|
|
|
|
xf86IDrvMsg(pInfo, X_ERROR, "Failed to set profile %s\n", profile);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
|
LibinputApplyConfigTap(DeviceIntPtr dev,
|
|
|
|
|
struct xf86libinput *driver_data,
|
|
|
|
|
struct libinput_device *device)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_tap_get_finger_count(device) > 0 &&
|
|
|
|
|
libinput_device_config_tap_set_enabled(device,
|
|
|
|
|
@@ -552,6 +600,17 @@ LibinputApplyConfig(DeviceIntPtr dev)
|
|
|
|
|
xf86IDrvMsg(pInfo, X_ERROR,
|
|
|
|
|
"Failed to set Tapping Drag to %d\n",
|
|
|
|
|
driver_data->options.tap_drag);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
LibinputApplyConfigCalibration(DeviceIntPtr dev,
|
|
|
|
|
struct xf86libinput *driver_data,
|
|
|
|
|
struct libinput_device *device)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_TOUCH|CAP_TABLET))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_calibration_has_matrix(device) &&
|
|
|
|
|
libinput_device_config_calibration_set_matrix(device,
|
|
|
|
|
@@ -564,6 +623,17 @@ LibinputApplyConfig(DeviceIntPtr dev)
|
|
|
|
|
driver_data->options.matrix[4], driver_data->options.matrix[5],
|
|
|
|
|
driver_data->options.matrix[6], driver_data->options.matrix[7],
|
|
|
|
|
driver_data->options.matrix[8]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
LibinputApplyConfigLeftHanded(DeviceIntPtr dev,
|
|
|
|
|
struct xf86libinput *driver_data,
|
|
|
|
|
struct libinput_device *device)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER|CAP_TABLET))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_left_handed_is_available(device) &&
|
|
|
|
|
libinput_device_config_left_handed_set(device,
|
|
|
|
|
@@ -571,6 +641,17 @@ LibinputApplyConfig(DeviceIntPtr dev)
|
|
|
|
|
xf86IDrvMsg(pInfo, X_ERROR,
|
|
|
|
|
"Failed to set LeftHanded to %d\n",
|
|
|
|
|
driver_data->options.left_handed);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
LibinputApplyConfigScrollMethod(DeviceIntPtr dev,
|
|
|
|
|
struct xf86libinput *driver_data,
|
|
|
|
|
struct libinput_device *device)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_scroll_set_method(device,
|
|
|
|
|
driver_data->options.scroll_method) != LIBINPUT_CONFIG_STATUS_SUCCESS) {
|
|
|
|
|
@@ -591,12 +672,25 @@ LibinputApplyConfig(DeviceIntPtr dev)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_scroll_get_methods(device) & LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN) {
|
|
|
|
|
unsigned int scroll_button;
|
|
|
|
|
|
|
|
|
|
scroll_button = btn_xorg2linux(driver_data->options.scroll_button);
|
|
|
|
|
if (libinput_device_config_scroll_set_button(device, scroll_button) != LIBINPUT_CONFIG_STATUS_SUCCESS)
|
|
|
|
|
xf86IDrvMsg(pInfo, X_ERROR,
|
|
|
|
|
"Failed to set ScrollButton to %u\n",
|
|
|
|
|
driver_data->options.scroll_button);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
LibinputApplyConfigClickMethod(DeviceIntPtr dev,
|
|
|
|
|
struct xf86libinput *driver_data,
|
|
|
|
|
struct libinput_device *device)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_click_set_method(device,
|
|
|
|
|
driver_data->options.click_method) != LIBINPUT_CONFIG_STATUS_SUCCESS) {
|
|
|
|
|
@@ -614,6 +708,17 @@ LibinputApplyConfig(DeviceIntPtr dev)
|
|
|
|
|
"Failed to set click method to %s\n",
|
|
|
|
|
method);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
LibinputApplyConfigMiddleEmulation(DeviceIntPtr dev,
|
|
|
|
|
struct xf86libinput *driver_data,
|
|
|
|
|
struct libinput_device *device)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_middle_emulation_is_available(device) &&
|
|
|
|
|
libinput_device_config_middle_emulation_set_enabled(device,
|
|
|
|
|
@@ -621,6 +726,17 @@ LibinputApplyConfig(DeviceIntPtr dev)
|
|
|
|
|
xf86IDrvMsg(pInfo, X_ERROR,
|
|
|
|
|
"Failed to set MiddleEmulation to %d\n",
|
|
|
|
|
driver_data->options.middle_emulation);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
LibinputApplyConfigDisableWhileTyping(DeviceIntPtr dev,
|
|
|
|
|
struct xf86libinput *driver_data,
|
|
|
|
|
struct libinput_device *device)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_dwt_is_available(device) &&
|
|
|
|
|
libinput_device_config_dwt_set_enabled(device,
|
|
|
|
|
@@ -628,13 +744,43 @@ LibinputApplyConfig(DeviceIntPtr dev)
|
|
|
|
|
xf86IDrvMsg(pInfo, X_ERROR,
|
|
|
|
|
"Failed to set DisableWhileTyping to %d\n",
|
|
|
|
|
driver_data->options.disable_while_typing);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
LibinputApplyConfigRotation(DeviceIntPtr dev,
|
|
|
|
|
struct xf86libinput *driver_data,
|
|
|
|
|
struct libinput_device *device)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_rotation_is_available(device) &&
|
|
|
|
|
libinput_device_config_rotation_set_angle(device, driver_data->options.rotation_angle) != LIBINPUT_CONFIG_STATUS_SUCCESS)
|
|
|
|
|
xf86IDrvMsg(pInfo, X_ERROR,
|
|
|
|
|
"Failed to set RotationAngle to %.2f\n",
|
|
|
|
|
driver_data->options.rotation_angle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
|
LibinputApplyConfig(DeviceIntPtr dev)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
struct xf86libinput *driver_data = pInfo->private;
|
|
|
|
|
struct libinput_device *device = driver_data->shared_device->device;
|
|
|
|
|
|
|
|
|
|
LibinputApplyConfigSendEvents(dev, driver_data, device);
|
|
|
|
|
LibinputApplyConfigNaturalScroll(dev, driver_data, device);
|
|
|
|
|
LibinputApplyConfigAccel(dev, driver_data, device);
|
|
|
|
|
LibinputApplyConfigTap(dev, driver_data, device);
|
|
|
|
|
LibinputApplyConfigCalibration(dev, driver_data, device);
|
|
|
|
|
LibinputApplyConfigLeftHanded(dev, driver_data, device);
|
|
|
|
|
LibinputApplyConfigScrollMethod(dev, driver_data, device);
|
|
|
|
|
LibinputApplyConfigClickMethod(dev, driver_data, device);
|
|
|
|
|
LibinputApplyConfigMiddleEmulation(dev, driver_data, device);
|
|
|
|
|
LibinputApplyConfigDisableWhileTyping(dev, driver_data, device);
|
|
|
|
|
LibinputApplyConfigRotation(dev, driver_data, device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
@@ -912,11 +1058,13 @@ xf86libinput_init_touch(InputInfoPtr pInfo)
|
|
|
|
|
{
|
|
|
|
|
DeviceIntPtr dev = pInfo->dev;
|
|
|
|
|
struct xf86libinput *driver_data = pInfo->private;
|
|
|
|
|
struct libinput_device *device = driver_data->shared_device->device;
|
|
|
|
|
int min, max, res;
|
|
|
|
|
unsigned char btnmap[MAX_BUTTONS + 1];
|
|
|
|
|
Atom btnlabels[MAX_BUTTONS];
|
|
|
|
|
Atom axislabels[TOUCHPAD_NUM_AXES];
|
|
|
|
|
int nbuttons = 7;
|
|
|
|
|
int ntouches = TOUCH_MAX_SLOTS;
|
|
|
|
|
|
|
|
|
|
init_button_map(btnmap, ARRAY_SIZE(btnmap));
|
|
|
|
|
init_button_labels(btnlabels, ARRAY_SIZE(btnlabels));
|
|
|
|
|
@@ -940,7 +1088,13 @@ xf86libinput_init_touch(InputInfoPtr pInfo)
|
|
|
|
|
xf86InitValuatorAxisStruct(dev, 1,
|
|
|
|
|
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_Y),
|
|
|
|
|
min, max, res * 1000, 0, res * 1000, Absolute);
|
|
|
|
|
InitTouchClassDeviceStruct(dev, TOUCH_MAX_SLOTS, XIDirectTouch, 2);
|
|
|
|
|
|
|
|
|
|
#if HAVE_LIBINPUT_TOUCH_COUNT
|
|
|
|
|
ntouches = libinput_device_touch_get_touch_count(device);
|
|
|
|
|
if (ntouches == 0) /* unknown - mtdev */
|
|
|
|
|
ntouches = TOUCH_MAX_SLOTS;
|
|
|
|
|
#endif
|
|
|
|
|
InitTouchClassDeviceStruct(dev, ntouches, XIDirectTouch, 2);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2538,9 +2692,9 @@ xf86libinput_parse_calibration_option(InputInfoPtr pInfo,
|
|
|
|
|
libinput_device_config_calibration_get_matrix(device, matrix);
|
|
|
|
|
memcpy(matrix_out, matrix, sizeof(matrix));
|
|
|
|
|
|
|
|
|
|
str = xf86CheckStrOption(pInfo->options,
|
|
|
|
|
"CalibrationMatrix",
|
|
|
|
|
NULL);
|
|
|
|
|
str = xf86SetStrOption(pInfo->options,
|
|
|
|
|
"CalibrationMatrix",
|
|
|
|
|
NULL);
|
|
|
|
|
if (!str)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
@@ -2768,7 +2922,7 @@ xf86libinput_parse_draglock_option(InputInfoPtr pInfo,
|
|
|
|
|
{
|
|
|
|
|
char *str;
|
|
|
|
|
|
|
|
|
|
str = xf86CheckStrOption(pInfo->options, "DragLockButtons",NULL);
|
|
|
|
|
str = xf86SetStrOption(pInfo->options, "DragLockButtons", NULL);
|
|
|
|
|
if (draglock_init_from_string(&driver_data->draglock, str) != 0)
|
|
|
|
|
xf86IDrvMsg(pInfo, X_ERROR,
|
|
|
|
|
"Invalid DragLockButtons option: \"%s\"\n",
|
|
|
|
|
@@ -4429,6 +4583,9 @@ LibinputInitTapProperty(DeviceIntPtr dev,
|
|
|
|
|
{
|
|
|
|
|
BOOL tap = driver_data->options.tapping;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_tap_get_finger_count(device) == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
@@ -4455,6 +4612,9 @@ LibinputInitTapDragProperty(DeviceIntPtr dev,
|
|
|
|
|
{
|
|
|
|
|
BOOL drag = driver_data->options.tap_drag;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_tap_get_finger_count(device) == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
@@ -4479,6 +4639,9 @@ LibinputInitTapDragLockProperty(DeviceIntPtr dev,
|
|
|
|
|
{
|
|
|
|
|
BOOL drag_lock = driver_data->options.tap_drag_lock;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_tap_get_finger_count(device) == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
@@ -4504,6 +4667,9 @@ LibinputInitTapButtonmapProperty(DeviceIntPtr dev,
|
|
|
|
|
enum libinput_config_tap_button_map map;
|
|
|
|
|
BOOL data[2] = {0};
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
map = driver_data->options.tap_button_map;
|
|
|
|
|
|
|
|
|
|
if (libinput_device_config_tap_get_finger_count(device) == 0)
|
|
|
|
|
@@ -4554,6 +4720,9 @@ LibinputInitCalibrationProperty(DeviceIntPtr dev,
|
|
|
|
|
{
|
|
|
|
|
float calibration[9];
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER|CAP_TOUCH|CAP_TABLET))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!libinput_device_config_calibration_has_matrix(device))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
@@ -4591,6 +4760,9 @@ LibinputInitAccelProperty(DeviceIntPtr dev,
|
|
|
|
|
enum libinput_config_accel_profile profile;
|
|
|
|
|
BOOL profiles[2] = {FALSE};
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!libinput_device_config_accel_is_available(device) ||
|
|
|
|
|
driver_data->capabilities & CAP_TABLET)
|
|
|
|
|
return;
|
|
|
|
|
@@ -4678,6 +4850,9 @@ LibinputInitNaturalScrollProperty(DeviceIntPtr dev,
|
|
|
|
|
{
|
|
|
|
|
BOOL natural_scroll = driver_data->options.natural_scrolling;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!libinput_device_config_scroll_has_natural_scroll(device))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
@@ -4760,6 +4935,9 @@ LibinputInitLeftHandedProperty(DeviceIntPtr dev,
|
|
|
|
|
{
|
|
|
|
|
BOOL left_handed = driver_data->options.left_handed;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER|CAP_TABLET))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!libinput_device_config_left_handed_is_available(device) ||
|
|
|
|
|
driver_data->capabilities & CAP_TABLET)
|
|
|
|
|
return;
|
|
|
|
|
@@ -4787,6 +4965,9 @@ LibinputInitScrollMethodsProperty(DeviceIntPtr dev,
|
|
|
|
|
enum libinput_config_scroll_method method;
|
|
|
|
|
BOOL methods[3] = {FALSE};
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
scroll_methods = libinput_device_config_scroll_get_methods(device);
|
|
|
|
|
if (scroll_methods == LIBINPUT_CONFIG_SCROLL_NO_SCROLL)
|
|
|
|
|
return;
|
|
|
|
|
@@ -4874,6 +5055,9 @@ LibinputInitClickMethodsProperty(DeviceIntPtr dev,
|
|
|
|
|
enum libinput_config_click_method method;
|
|
|
|
|
BOOL methods[2] = {FALSE};
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
click_methods = libinput_device_config_click_get_methods(device);
|
|
|
|
|
if (click_methods == LIBINPUT_CONFIG_CLICK_METHOD_NONE)
|
|
|
|
|
return;
|
|
|
|
|
@@ -4942,6 +5126,9 @@ LibinputInitMiddleEmulationProperty(DeviceIntPtr dev,
|
|
|
|
|
{
|
|
|
|
|
BOOL middle = driver_data->options.middle_emulation;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!libinput_device_config_middle_emulation_is_available(device))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
@@ -4968,6 +5155,9 @@ LibinputInitDisableWhileTypingProperty(DeviceIntPtr dev,
|
|
|
|
|
{
|
|
|
|
|
BOOL dwt = driver_data->options.disable_while_typing;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!libinput_device_config_dwt_is_available(device))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
@@ -5000,6 +5190,9 @@ LibinputInitModeGroupProperties(DeviceIntPtr dev,
|
|
|
|
|
associations[MAX_BUTTONS] = {0};
|
|
|
|
|
int g, b, r, s;
|
|
|
|
|
|
|
|
|
|
if (!subdevice_has_capabilities(dev, CAP_TABLET_PAD))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_PAD))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
@@ -5133,7 +5326,7 @@ LibinputInitDragLockProperty(DeviceIntPtr dev,
|
|
|
|
|
break;
|
|
|
|
|
case DRAGLOCK_PAIRS:
|
|
|
|
|
sz = draglock_get_pairs(&driver_data->draglock,
|
|
|
|
|
dl_values, sizeof(dl_values));
|
|
|
|
|
dl_values, ARRAY_SIZE(dl_values));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
xf86IDrvMsg(dev->public.devicePrivate,
|
|
|
|
|
@@ -5238,19 +5431,6 @@ LibinputInitTabletAreaRatioProperty(DeviceIntPtr dev,
|
|
|
|
|
2, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline bool
|
|
|
|
|
subdevice_filter_for_capabilities(DeviceIntPtr dev,
|
|
|
|
|
uint32_t capabilities)
|
|
|
|
|
{
|
|
|
|
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
|
|
|
|
struct xf86libinput *driver_data = pInfo->private;
|
|
|
|
|
|
|
|
|
|
if (!xf86libinput_is_subdevice(pInfo))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return !(driver_data->capabilities & capabilities);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
LibinputInitProperty(DeviceIntPtr dev)
|
|
|
|
|
{
|
|
|
|
|
@@ -5263,35 +5443,21 @@ LibinputInitProperty(DeviceIntPtr dev)
|
|
|
|
|
|
|
|
|
|
prop_float = XIGetKnownProperty("FLOAT");
|
|
|
|
|
|
|
|
|
|
/* On a subdevice, we likely only have a keyboard, so filter out the
|
|
|
|
|
* properties for the capabilities we don't have */
|
|
|
|
|
if (!subdevice_filter_for_capabilities(dev, CAP_POINTER|CAP_TOUCH)) {
|
|
|
|
|
LibinputInitTapProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitTapDragProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitTapDragLockProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitTapButtonmapProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitNaturalScrollProperty(dev, driver_data, device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!subdevice_filter_for_capabilities(dev, CAP_TOUCH|CAP_TABLET)) {
|
|
|
|
|
LibinputInitCalibrationProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitLeftHandedProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitAccelProperty(dev, driver_data, device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!subdevice_filter_for_capabilities(dev, CAP_POINTER)) {
|
|
|
|
|
LibinputInitScrollMethodsProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitClickMethodsProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitMiddleEmulationProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitRotationAngleProperty(dev, driver_data, device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!subdevice_filter_for_capabilities(dev, CAP_TABLET_PAD)) {
|
|
|
|
|
LibinputInitModeGroupProperties(dev, driver_data, device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LibinputInitSendEventsProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitTapProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitTapDragProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitTapDragLockProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitTapButtonmapProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitNaturalScrollProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitDisableWhileTypingProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitScrollMethodsProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitClickMethodsProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitMiddleEmulationProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitRotationAngleProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitAccelProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitCalibrationProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitLeftHandedProperty(dev, driver_data, device);
|
|
|
|
|
LibinputInitModeGroupProperties(dev, driver_data, device);
|
|
|
|
|
LibinputInitSendEventsProperty(dev, driver_data, device);
|
|
|
|
|
|
|
|
|
|
/* Device node property, read-only */
|
|
|
|
|
device_node = driver_data->path;
|
|
|
|
|
|