diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2014-07-22 22:49:41 +0200 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2014-08-15 15:33:55 +0300 |
commit | 05e4a1f768bbeecb357a449924cd8a9f2b6b0112 (patch) | |
tree | d584c93ba1945f59cbaf2927c34b58a3a24bcba9 | |
parent | 886b0098c3bc856dc7c945a3f424e8b64cbc1a7c (diff) | |
download | weston-05e4a1f768bbeecb357a449924cd8a9f2b6b0112.tar.gz |
libinput: Add tap configuration to weston.ini
Enable by adding the following to your weston.ini:
[libinput]
enable_tap=true
This also makes weston require libinput >= 0.5.0.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/libinput-device.c | 25 | ||||
-rw-r--r-- | weston.ini.in | 3 |
3 files changed, 29 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 19380781..354db145 100644 --- a/configure.ac +++ b/configure.ac @@ -160,7 +160,7 @@ AC_ARG_ENABLE(libinput-backend, [ --enable-libinput-backend],, AM_CONDITIONAL([ENABLE_LIBINPUT_BACKEND], [test x$enable_libinput_backend = xyes]) if test x$enable_libinput_backend = xyes; then AC_DEFINE([BUILD_LIBINPUT_BACKEND], [1], [Build the libinput input device backend]) - PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.4.0]) + PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.5.0]) fi diff --git a/src/libinput-device.c b/src/libinput-device.c index 2ba4ec37..6e50eebb 100644 --- a/src/libinput-device.c +++ b/src/libinput-device.c @@ -297,6 +297,29 @@ evdev_device_set_output(struct evdev_device *device, &device->output_destroy_listener); } +static void +configure_device(struct evdev_device *device) +{ + struct weston_compositor *compositor = device->seat->compositor; + struct weston_config_section *s; + int enable_tap; + int enable_tap_default; + + s = weston_config_get_section(compositor->config, + "libinput", NULL, NULL); + + if (libinput_device_config_tap_get_finger_count(device->device) > 0) { + enable_tap_default = + libinput_device_config_tap_get_default_enabled( + device->device); + weston_config_section_get_bool(s, "enable_tap", + &enable_tap, + enable_tap_default); + libinput_device_config_tap_set_enabled(device->device, + enable_tap); + } +} + struct evdev_device * evdev_device_create(struct libinput_device *libinput_device, struct weston_seat *seat) @@ -330,6 +353,8 @@ evdev_device_create(struct libinput_device *libinput_device, libinput_device_set_user_data(libinput_device, device); libinput_device_ref(libinput_device); + configure_device(device); + return device; } diff --git a/weston.ini.in b/weston.ini.in index 03fbde27..4fca0bbb 100644 --- a/weston.ini.in +++ b/weston.ini.in @@ -61,6 +61,9 @@ path=@libexecdir@/weston-keyboard #mode=1024x768 #transform=flipped-90 +#[libinput] +#enable_tap=true + #[touchpad] #constant_accel_factor = 50 #min_accel_factor = 0.16 |