aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2017-12-24 07:38:21 +0100
committerDominique Martinet <asmadeus@codewreck.org>2017-12-24 14:55:38 +0100
commite85c2827c8929ed39d0931ba054047b0a35e7dcc (patch)
treea701435397e2722cb114ab0c0598081535cba394 /rootston
parente04d3501133dc0c73bb43af323bca51ab0b352a1 (diff)
rootston: add arbitrary libinput config 'tap_enabled'
This ought to be enough to serve as an example for other compositors to use.
Diffstat (limited to 'rootston')
-rw-r--r--rootston/config.c10
-rw-r--r--rootston/input.c12
-rw-r--r--rootston/rootston.ini.example1
3 files changed, 23 insertions, 0 deletions
diff --git a/rootston/config.c b/rootston/config.c
index ed91d4fd..dd741186 100644
--- a/rootston/config.c
+++ b/rootston/config.c
@@ -342,6 +342,16 @@ static int config_ini_handler(void *user, const char *section, const char *name,
} else if (strcmp(name, "seat") == 0) {
free(dc->seat);
dc->seat = strdup(value);
+ } else if (strcmp(name, "tap_enabled") == 0) {
+ if (strcasecmp(value, "true") == 0) {
+ dc->tap_enabled = true;
+ } else if (strcasecmp(value, "false") == 0) {
+ dc->tap_enabled = false;
+ } else {
+ wlr_log(L_ERROR,
+ "got unknown tap_enabled value: %s",
+ value);
+ }
} else {
wlr_log(L_ERROR, "got unknown device config: %s", name);
}
diff --git a/rootston/input.c b/rootston/input.c
index a3904a61..74ce59d0 100644
--- a/rootston/input.c
+++ b/rootston/input.c
@@ -5,6 +5,7 @@
#include <wlr/util/log.h>
#include <wlr/xcursor.h>
#include <wlr/xwayland.h>
+#include <wlr/backend/libinput.h>
#include "rootston/server.h"
#include "rootston/config.h"
#include "rootston/input.h"
@@ -60,6 +61,17 @@ static void input_add_notify(struct wl_listener *listener, void *data) {
device->vendor, device->product, device_type(device->type), seat_name);
roots_seat_add_device(seat, device);
+
+ if (dc && wlr_input_device_is_libinput(device)) {
+ struct libinput_device *libinput_dev =
+ wlr_libinput_get_device_handle(device);
+
+ wlr_log(L_DEBUG, "input has config, tap_enabled: %d\n", dc->tap_enabled);
+ if (dc->tap_enabled) {
+ libinput_device_config_tap_set_enabled(libinput_dev,
+ LIBINPUT_CONFIG_TAP_ENABLED);
+ }
+ }
}
static void input_remove_notify(struct wl_listener *listener, void *data) {
diff --git a/rootston/rootston.ini.example b/rootston/rootston.ini.example
index a2fabb6b..0d19b751 100644
--- a/rootston/rootston.ini.example
+++ b/rootston/rootston.ini.example
@@ -30,6 +30,7 @@ theme = default
map-to-output = VGA-1
# Restrict cursor movements for this mouse to concrete rectangle
geometry = 2500x800
+# tap_enabled=true
[keyboard]
meta-key = Logo