Compare commits

...

12 Commits

Author SHA1 Message Date
Peter Hutterer
278a685c5a xf86-input-libinput 0.7.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-24 14:45:12 +10:00
Peter Hutterer
875f1696b7 Only apply left-handed/scroll button configuration when it's available
https://bugs.freedesktop.org/show_bug.cgi?id=88961

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-04 14:14:13 +10:00
Friedrich Schöller
45e9b6c64b Reapply configuration at DEVICE_ON
The driver ignored my xorg configuration. Maybe I am doing something wrong,
but I tried to track down the error and came up with this solution.

The device is closed after DEVICE_INIT so we need to apply configuration
options at DEVICE_ON.

Signed-off-by: Friedrich Schöller <code@schoeller.se>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-30 09:47:22 +10:00
Peter Hutterer
dcdf1e24c8 Formatting fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-30 09:47:19 +10:00
Peter Hutterer
64e1b14598 xf86-input-libinput 0.6.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-27 10:08:32 +10:00
Peter Hutterer
e729451bb1 Swap button labels for back/forward to align with linux/input.h
We just forward the kernel buttons, so this should be in the same order.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-27 07:51:34 +10:00
Olivier Fourdan
7d73602c4b Move properties to a separate header
And install the header as part of the SDK, so that applications interfacing
with the libinput driver do not have to copy paste all the properties' names.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-21 11:57:58 +10:00
Peter Hutterer
00b96de351 Revert "libinput-drv: Move properties to a separate header"
Missing the pkg-config file, updated patch coming up.

This reverts commit 8ceed9c73d.
2015-01-21 11:56:35 +10:00
Olivier Fourdan
8ceed9c73d libinput-drv: Move properties to a separate header
And install the header as part of the SDK, so that applications interfacing
with the libinput driver do not have to copy paste all the properties' names.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-21 07:15:48 +10:00
Olivier Fourdan
e4cd6cef91 libinput-drv: Add autogen.sh
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-21 07:13:46 +10:00
Peter Hutterer
7bc662d0b4 Remove unused define
Obsolete since 2348a6812a

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-19 14:36:59 +10:00
Peter Hutterer
a55cb9121a Move the property #defines up
Since they serve as documentation, make them easier to find.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-19 14:36:19 +10:00
7 changed files with 127 additions and 63 deletions

View File

@@ -21,9 +21,12 @@
DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg'
SUBDIRS = src man
SUBDIRS = src include man
MAINTAINERCLEANFILES = ChangeLog INSTALL
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xorg-libinput.pc
.PHONY: ChangeLog INSTALL
INSTALL:

14
autogen.sh Executable file
View File

@@ -0,0 +1,14 @@
#! /bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
if test -z "$NOCONFIGURE"; then
exec $srcdir/configure "$@"
fi

View File

@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-input-libinput],
[0.5.0],
[0.7.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-input-libinput])
AC_CONFIG_SRCDIR([Makefile.am])
@@ -68,6 +68,8 @@ DRIVER_NAME=libinput
AC_SUBST([DRIVER_NAME])
AC_CONFIG_FILES([Makefile
include/Makefile
src/Makefile
man/Makefile])
man/Makefile
xorg-libinput.pc])
AC_OUTPUT

1
include/Makefile.am Normal file
View File

@@ -0,0 +1 @@
sdk_HEADERS = libinput-properties.h

View File

@@ -0,0 +1,61 @@
/*
* Copyright © 2015 Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of Red Hat
* not be used in advertising or publicity pertaining to distribution
* of the software without specific, written prior permission. Red
* Hat makes no representations about the suitability of this software
* for any purpose. It is provided "as is" without express or implied
* warranty.
*
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _LIBINPUT_PROPERTIES_H_
#define _LIBINPUT_PROPERTIES_H_
/* Tapping enabled/disabled: BOOL, 1 value */
#define LIBINPUT_PROP_TAP "libinput Tapping Enabled"
/* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows */
#define LIBINPUT_PROP_CALIBRATION "libinput Calibration Matrix"
/* Pointer accel speed: FLOAT, 1 value, 32 bit */
#define LIBINPUT_PROP_ACCEL "libinput Accel Speed"
/* Natural scrolling: BOOL, 1 value */
#define LIBINPUT_PROP_NATURAL_SCROLL "libinput Natural Scrolling Enabled"
/* Send-events mode: BOOL read-only, 2 values in order disabled,
disabled-on-external-mouse */
#define LIBINPUT_PROP_SENDEVENTS_AVAILABLE "libinput Send Events Modes Available"
/* Send-events mode: BOOL, 2 values in order disabled,
disabled-on-external-mouse */
#define LIBINPUT_PROP_SENDEVENTS_ENABLED "libinput Send Events Mode Enabled"
/* Left-handed enabled/disabled: BOOL, 1 value */
#define LIBINPUT_PROP_LEFT_HANDED "libinput Left Handed Enabled"
/* Scroll method: BOOL read-only, 3 values in order 2fg, edge, button.
shows available scroll methods */
#define LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE "libinput Scroll Methods Available"
/* Scroll method: BOOL, 3 values in order 2fg, edge, button
only one is enabled at a time at max */
#define LIBINPUT_PROP_SCROLL_METHOD_ENABLED "libinput Scroll Method Enabled"
/* Scroll button for button scrolling: 32-bit int, 1 value */
#define LIBINPUT_PROP_SCROLL_BUTTON "libinput Button Scrolling Button"
#endif /* _LIBINPUT_PROPERTIES_H_ */

View File

@@ -41,6 +41,8 @@
#include <X11/Xatom.h>
#include "libinput-properties.h"
#ifndef XI86_SERVER_FD
#define XI86_SERVER_FD 0x20
#endif
@@ -57,12 +59,6 @@
*/
#define TOUCH_AXIS_MAX 0xffff
/*
libinput scales wheel events by DEFAULT_AXIS_STEP_DISTANCE, which is
currently 15.
*/
#define DEFAULT_LIBINPUT_AXIS_STEP_DISTANCE 15
struct xf86libinput_driver {
struct libinput *libinput;
int device_enabled_count;
@@ -263,7 +259,8 @@ LibinputApplyConfig(DeviceIntPtr dev)
driver_data->options.matrix[6], driver_data->options.matrix[7],
driver_data->options.matrix[8]);
if (libinput_device_config_left_handed_set(device,
if (libinput_device_config_left_handed_is_available(device) &&
libinput_device_config_left_handed_set(device,
driver_data->options.left_handed) != LIBINPUT_CONFIG_STATUS_SUCCESS)
xf86IDrvMsg(pInfo, X_ERROR,
"Failed to set LeftHanded to %d\n",
@@ -287,11 +284,13 @@ LibinputApplyConfig(DeviceIntPtr dev)
method);
}
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 %d\n",
driver_data->options.scroll_button);
if (libinput_device_config_scroll_get_methods(device) & LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN) {
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 %d\n",
driver_data->options.scroll_button);
}
}
static int
@@ -330,6 +329,8 @@ xf86libinput_on(DeviceIntPtr dev)
driver_context.device_enabled_count++;
dev->public.on = TRUE;
LibinputApplyConfig(dev);
return Success;
}
@@ -390,8 +391,8 @@ init_button_labels(Atom *labels, size_t size)
labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT);
labels[7] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_SIDE);
labels[8] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_EXTRA);
labels[9] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_BACK);
labels[10] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_FORWARD);
labels[9] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_FORWARD);
labels[10] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_BACK);
}
static void
@@ -1119,9 +1120,10 @@ xf86libinput_parse_options(InputInfoPtr pInfo,
}
static int xf86libinput_pre_init(InputDriverPtr drv,
InputInfoPtr pInfo,
int flags)
static int
xf86libinput_pre_init(InputDriverPtr drv,
InputInfoPtr pInfo,
int flags)
{
struct xf86libinput *driver_data = NULL;
struct libinput *libinput = NULL;
@@ -1274,31 +1276,6 @@ _X_EXPORT XF86ModuleData libinputModuleData = {
/* Property support */
/* Tapping enabled/disabled: BOOL, 1 value */
#define PROP_TAP "libinput Tapping Enabled"
/* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows */
#define PROP_CALIBRATION "libinput Calibration Matrix"
/* Pointer accel speed: FLOAT, 1 value, 32 bit */
#define PROP_ACCEL "libinput Accel Speed"
/* Natural scrolling: BOOL, 1 value */
#define PROP_NATURAL_SCROLL "libinput Natural Scrolling Enabled"
/* Send-events mode: BOOL read-only, 2 values in order disabled,
disabled-on-external-mouse */
#define PROP_SENDEVENTS_AVAILABLE "libinput Send Events Modes Available"
/* Send-events mode: BOOL, 2 values in order disabled,
disabled-on-external-mouse */
#define PROP_SENDEVENTS_ENABLED "libinput Send Events Mode Enabled"
/* Left-handed enabled/disabled: BOOL, 1 value */
#define PROP_LEFT_HANDED "libinput Left Handed Enabled"
/* Scroll method: BOOL read-only, 3 values in order 2fg, edge, button.
shows available scroll methods */
#define PROP_SCROLL_METHODS_AVAILABLE "libinput Scroll Methods Available"
/* Scroll method: BOOL, 3 values in order 2fg, edge, button
only one is enabled at a time at max */
#define PROP_SCROLL_METHOD_ENABLED "libinput Scroll Method Enabled"
/* Scroll button for button scrolling: 32-bit int, 1 value */
#define PROP_SCROLL_BUTTON "libinput Button Scrolling Button"
/* libinput-specific properties */
static Atom prop_tap;
static Atom prop_calibration;
@@ -1624,7 +1601,7 @@ LibinputInitProperty(DeviceIntPtr dev)
if (libinput_device_config_tap_get_finger_count(device) > 0) {
BOOL tap = driver_data->options.tapping;
prop_tap = MakeAtom(PROP_TAP, strlen(PROP_TAP), TRUE);
prop_tap = MakeAtom(LIBINPUT_PROP_TAP, strlen(LIBINPUT_PROP_TAP), TRUE);
rc = XIChangeDeviceProperty(dev, prop_tap, XA_INTEGER, 8,
PropModeReplace, 1, &tap, FALSE);
if (rc != Success)
@@ -1642,8 +1619,8 @@ LibinputInitProperty(DeviceIntPtr dev)
calibration[7] = 0;
calibration[8] = 1;
prop_calibration = MakeAtom(PROP_CALIBRATION,
strlen(PROP_CALIBRATION),
prop_calibration = MakeAtom(LIBINPUT_PROP_CALIBRATION,
strlen(LIBINPUT_PROP_CALIBRATION),
TRUE);
rc = XIChangeDeviceProperty(dev, prop_calibration, prop_float, 32,
@@ -1656,7 +1633,7 @@ LibinputInitProperty(DeviceIntPtr dev)
if (libinput_device_config_accel_is_available(device)) {
float speed = driver_data->options.speed;
prop_accel = MakeAtom(PROP_ACCEL, strlen(PROP_ACCEL), TRUE);
prop_accel = MakeAtom(LIBINPUT_PROP_ACCEL, strlen(LIBINPUT_PROP_ACCEL), TRUE);
rc = XIChangeDeviceProperty(dev, prop_accel, prop_float, 32,
PropModeReplace, 1, &speed, FALSE);
if (rc != Success)
@@ -1667,8 +1644,8 @@ LibinputInitProperty(DeviceIntPtr dev)
if (libinput_device_config_scroll_has_natural_scroll(device)) {
BOOL natural_scroll = driver_data->options.natural_scrolling;
prop_natural_scroll = MakeAtom(PROP_NATURAL_SCROLL,
strlen(PROP_NATURAL_SCROLL),
prop_natural_scroll = MakeAtom(LIBINPUT_PROP_NATURAL_SCROLL,
strlen(LIBINPUT_PROP_NATURAL_SCROLL),
TRUE);
rc = XIChangeDeviceProperty(dev, prop_natural_scroll, XA_INTEGER, 8,
PropModeReplace, 1, &natural_scroll, FALSE);
@@ -1687,8 +1664,8 @@ LibinputInitProperty(DeviceIntPtr dev)
if (sendevent_modes & LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE)
modes[1] = TRUE;
prop_sendevents_available = MakeAtom(PROP_SENDEVENTS_AVAILABLE,
strlen(PROP_SENDEVENTS_AVAILABLE),
prop_sendevents_available = MakeAtom(LIBINPUT_PROP_SENDEVENTS_AVAILABLE,
strlen(LIBINPUT_PROP_SENDEVENTS_AVAILABLE),
TRUE);
rc = XIChangeDeviceProperty(dev, prop_sendevents_available,
XA_INTEGER, 8,
@@ -1709,8 +1686,8 @@ LibinputInitProperty(DeviceIntPtr dev)
break;
}
prop_sendevents_enabled = MakeAtom(PROP_SENDEVENTS_ENABLED,
strlen(PROP_SENDEVENTS_ENABLED),
prop_sendevents_enabled = MakeAtom(LIBINPUT_PROP_SENDEVENTS_ENABLED,
strlen(LIBINPUT_PROP_SENDEVENTS_ENABLED),
TRUE);
rc = XIChangeDeviceProperty(dev, prop_sendevents_enabled,
XA_INTEGER, 8,
@@ -1724,8 +1701,8 @@ LibinputInitProperty(DeviceIntPtr dev)
if (libinput_device_config_left_handed_is_available(device)) {
BOOL left_handed = driver_data->options.left_handed;
prop_left_handed = MakeAtom(PROP_LEFT_HANDED,
strlen(PROP_LEFT_HANDED),
prop_left_handed = MakeAtom(LIBINPUT_PROP_LEFT_HANDED,
strlen(LIBINPUT_PROP_LEFT_HANDED),
TRUE);
rc = XIChangeDeviceProperty(dev, prop_left_handed,
XA_INTEGER, 8,
@@ -1748,8 +1725,8 @@ LibinputInitProperty(DeviceIntPtr dev)
methods[2] = TRUE;
prop_scroll_methods_available =
MakeAtom(PROP_SCROLL_METHODS_AVAILABLE,
strlen(PROP_SCROLL_METHODS_AVAILABLE),
MakeAtom(LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE,
strlen(LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE),
TRUE);
rc = XIChangeDeviceProperty(dev,
prop_scroll_methods_available,
@@ -1781,8 +1758,8 @@ LibinputInitProperty(DeviceIntPtr dev)
}
prop_scroll_method_enabled =
MakeAtom(PROP_SCROLL_METHOD_ENABLED,
strlen(PROP_SCROLL_METHOD_ENABLED),
MakeAtom(LIBINPUT_PROP_SCROLL_METHOD_ENABLED,
strlen(LIBINPUT_PROP_SCROLL_METHOD_ENABLED),
TRUE);
rc = XIChangeDeviceProperty(dev,
prop_scroll_method_enabled,
@@ -1802,8 +1779,8 @@ LibinputInitProperty(DeviceIntPtr dev)
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN) {
CARD32 scroll_button = driver_data->options.scroll_button;
prop_scroll_button = MakeAtom(PROP_SCROLL_BUTTON,
strlen(PROP_SCROLL_BUTTON),
prop_scroll_button = MakeAtom(LIBINPUT_PROP_SCROLL_BUTTON,
strlen(LIBINPUT_PROP_SCROLL_BUTTON),
TRUE);
rc = XIChangeDeviceProperty(dev, prop_scroll_button,
XA_CARDINAL, 32,

6
xorg-libinput.pc.in Normal file
View File

@@ -0,0 +1,6 @@
sdkdir=@sdkdir@
Name: xorg-libinput
Description: X.Org libinput input driver.
Version: @PACKAGE_VERSION@
Cflags: -I${sdkdir}