Compare commits

...

12 Commits

Author SHA1 Message Date
Peter Hutterer
e26fc3c66c xf86-input-libinput 0.28.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-10-15 09:36:36 +10:00
Peter Hutterer
a759610292 Use the seat slot, not the device slot for touch events
The device slot is per-device, so if we have more than one device we may get a
touch down event for a slot already in use.

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/153

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-10-04 11:47:46 +10:00
Peter Hutterer
21ff2ca7d1 Remove unused assignment
dev is our list iterator below, this is a dead assignment

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-19 15:58:06 +10:00
Peter Hutterer
c67f191d5b xf86-input-libinput 0.28.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 11:06:59 +10:00
Peter Hutterer
1978a2555b Minor whitespace fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 10:59:20 +10:00
Peter Hutterer
0909a1a765 draglock: fix memory overwrite during draglock parsing
Passing in the size of the array but using it as "number of elements" inside
the function. Rename a bunch of arguments to avoid this.

https://bugs.freedesktop.org/show_bug.cgi?id=107166

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-10 11:17:50 +10:00
Peter Hutterer
20bb8d6b9f Revert "Implement the custom acceleration curve options"
Custom pointer acceleration curves were reverted in libinput, so no point
having this code here.

This reverts commit d84e0035d1.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-23 08:14:23 +10:00
Peter Hutterer
1e88664d95 Use the libinput touch count to init the right number of touches
Initial version by Johannes Pointner <h4nn35.work@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-02 13:59:00 +10:00
Peter Hutterer
d84e0035d1 Implement the custom acceleration curve options
One new property, and the existing accel profile gets extended to keep one
extra value. The new property libinput Accel Curve Points is a list of pairs
of points to be added to the acceleration curve.

libinput only supports adding points to the curve so we simply declare the
behavior as undefined when the curve is set multiple times. Also helps to
identify those that bother to read the man page before playing with random
driver values.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-20 14:04:25 +10:00
Peter Hutterer
6c75acfcdf Use xf86SetStrOption to check for string options
This one shows up in the log and marks it as used.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-20 13:34:23 +10:00
Peter Hutterer
eaf847be16 man: whitespace fixes in man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-17 15:11:12 +10:00
Peter Hutterer
d319092d55 man: fix formatting issue caused by invalid tag
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-17 13:52:33 +10:00
5 changed files with 48 additions and 23 deletions

View File

@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-input-libinput],
[0.27.1],
[0.28.1],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-input-libinput])
AC_CONFIG_SRCDIR([Makefile.am])
@@ -47,6 +47,23 @@ XORG_DEFAULT_OPTIONS
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto [inputproto >= 2.2])
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.4.901])
OLD_LIBS=$LIBS
OLD_CFLAGS=$CFLAGS
LIBS="$LIBS $LIBINPUT_LIBS"
CFLAGS="$CFLAGS $LIBINPUT_CFLAGS"
AC_MSG_CHECKING([if libinput_device_touch_get_touch_count is available])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <libinput.h>]],
[[libinput_device_touch_get_touch_count(NULL)]])],
[AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_LIBINPUT_TOUCH_COUNT, [1],
[libinput_device_touch_get_touch_count() is available])
[libinput_have_touch_count=yes]],
[AC_MSG_RESULT([no])
[libinput_have_touch_count=no]])
LIBS=$OLD_LIBS
CFLAGS=$OLD_CFLAGS
# Define a configure option for an alternate input module directory
AC_ARG_WITH(xorg-module-dir,
AC_HELP_STRING([--with-xorg-module-dir=DIR],

View File

@@ -15,11 +15,11 @@ libinput \- libinput-based X.Org input driver
.SH NOTE
This is the man page for the X input driver. If you are looking for the
library documentation, go to
library documentation, go to
.BI http://wayland.freedesktop.org/libinput/doc/
.SH DESCRIPTION
.B libinput
.B libinput
is an __xservername__ input driver based on libinput. It
therefore supports all input devices that libinput can handle, including
most mice, keyboards, tablets and touchscreens.
@@ -37,7 +37,7 @@ Please refer to __xconfigfile__(__filemansuffix__) for general configuration
details and for options that can be used with all input drivers. This
section only covers configuration details specific to this driver.
.PP
The following driver
The following driver
.B Options
are supported:
.TP 7
@@ -277,7 +277,7 @@ enabled on this device.
.BI "libinput Tablet Tool Pressurecurve"
4 32-bit float values [0.0 to 1.0]. See section
.B TABLET TOOL PRESSURE CURVE
.TP7
.TP 7
.BI "libinput Tablet Tool Area Ratio"
2 32-bit values, corresponding to width and height. Special value 0, 0
resets to the default ratio. See section

View File

@@ -116,7 +116,7 @@ draglock_get_meta(const struct draglock *dl)
}
size_t
draglock_get_pairs(const struct draglock *dl, int *array, size_t sz)
draglock_get_pairs(const struct draglock *dl, int *array, size_t nelem)
{
unsigned int i;
size_t last = 0;
@@ -131,8 +131,8 @@ draglock_get_pairs(const struct draglock *dl, int *array, size_t sz)
}
/* size N array with a[0] == 0, the rest ordered by button number */
memset(array, 0, sz * sizeof(array[0]));
for (i = 0; i < sz && i < ARRAY_SIZE(dl->lock_pair); i++) {
memset(array, 0, nelem * sizeof(array[0]));
for (i = 0; i < nelem && i < ARRAY_SIZE(dl->lock_pair); i++) {
array[i] = dl->lock_pair[i];
if (array[i] != 0 && i > last)
last = i;
@@ -153,20 +153,20 @@ draglock_set_meta(struct draglock *dl, int meta_button)
}
int
draglock_set_pairs(struct draglock *dl, const int *array, size_t sz)
draglock_set_pairs(struct draglock *dl, const int *array, size_t nelem)
{
unsigned int i;
if (sz == 0 || array[0] != 0)
if (nelem == 0 || array[0] != 0)
return 1;
for (i = 0; i < sz; i++) {
for (i = 0; i < nelem; i++) {
if (array[i] < 0 || array[i] >= DRAGLOCK_MAX_BUTTONS)
return 1;
}
dl->mode = DRAGLOCK_DISABLED;
for (i = 0; i < sz; i++) {
for (i = 0; i < nelem; i++) {
dl->lock_pair[i] = array[i];
if (dl->lock_pair[i])
dl->mode = DRAGLOCK_PAIRS;

View File

@@ -107,13 +107,13 @@ draglock_get_meta(const struct draglock *dl);
* @note Button numbers start at 1, array[0] is always 0.
*
* @param[in|out] array Caller-allocated array to hold the button mappings.
* @param[in] sz Maximum number of elements in array
* @param[in] nelem Maximum number of elements in array
*
* @return The number of valid elements in array or 0 if the current mode is
* not DRAGLOCK_PAIRS
*/
size_t
draglock_get_pairs(const struct draglock *dl, int *array, size_t sz);
draglock_get_pairs(const struct draglock *dl, int *array, size_t nelem);
/**
* Set the drag lock config to the DRAGLOCK_META mode, with the given
@@ -140,7 +140,7 @@ draglock_set_meta(struct draglock *dl, int meta_button);
* @return 0 on successor nonzero otherwise
*/
int
draglock_set_pairs(struct draglock *dl, const int *array, size_t sz);
draglock_set_pairs(struct draglock *dl, const int *array, size_t nelem);
/**
* Process the given button event through the drag lock state machine.

View File

@@ -1058,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));
@@ -1086,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);
}
@@ -1697,7 +1705,7 @@ xf86libinput_handle_touch(InputInfoPtr pInfo,
if ((driver_data->capabilities & CAP_TOUCH) == 0)
return;
slot = libinput_event_touch_get_slot(event);
slot = libinput_event_touch_get_seat_slot(event);
switch (event_type) {
case LIBINPUT_EVENT_TOUCH_DOWN:
@@ -2084,7 +2092,7 @@ static inline DeviceIntPtr
xf86libinput_find_device_for_tool(InputInfoPtr pInfo,
struct libinput_tablet_tool *tool)
{
struct xf86libinput *dev = pInfo->private;
struct xf86libinput *dev;
struct xf86libinput *driver_data = pInfo->private;
struct xf86libinput_device *shared_device = driver_data->shared_device;
uint64_t serial = libinput_tablet_tool_get_serial(tool);
@@ -2684,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;
@@ -2914,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",
@@ -5318,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,