summaryrefslogtreecommitdiff
path: root/sway/input/input-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r--sway/input/input-manager.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index b4352c6a..32f0355e 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -120,6 +120,13 @@ static void input_manager_libinput_config_pointer(
libinput_device_config_click_set_method(libinput_device,
ic->click_method);
}
+ if (ic->drag != INT_MIN) {
+ wlr_log(WLR_DEBUG,
+ "libinput_config_pointer(%s) tap_set_drag_enabled(%d)",
+ ic->identifier, ic->click_method);
+ libinput_device_config_tap_set_drag_enabled(libinput_device,
+ ic->drag);
+ }
if (ic->drag_lock != INT_MIN) {
wlr_log(WLR_DEBUG,
"libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)",
@@ -233,7 +240,8 @@ static void handle_new_input(struct wl_listener *listener, void *data) {
wlr_log(WLR_DEBUG, "adding device: '%s'",
input_device->identifier);
- if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER) {
+ if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER ||
+ input_device->wlr_device->type == WLR_INPUT_DEVICE_TABLET_TOOL) {
input_manager_libinput_config_pointer(input_device);
}
@@ -389,9 +397,12 @@ void input_manager_set_focus(struct sway_input_manager *input,
void input_manager_apply_input_config(struct sway_input_manager *input,
struct input_config *input_config) {
struct sway_input_device *input_device = NULL;
+ bool wildcard = strcmp(input_config->identifier, "*") == 0;
wl_list_for_each(input_device, &input->devices, link) {
- if (strcmp(input_device->identifier, input_config->identifier) == 0) {
- if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER) {
+ if (strcmp(input_device->identifier, input_config->identifier) == 0
+ || wildcard) {
+ if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER ||
+ input_device->wlr_device->type == WLR_INPUT_DEVICE_TABLET_TOOL) {
input_manager_libinput_config_pointer(input_device);
}
@@ -480,13 +491,16 @@ struct sway_seat *input_manager_get_default_seat(
}
struct input_config *input_device_get_config(struct sway_input_device *device) {
+ struct input_config *wildcard_config = NULL;
struct input_config *input_config = NULL;
for (int i = 0; i < config->input_configs->length; ++i) {
input_config = config->input_configs->items[i];
if (strcmp(input_config->identifier, device->identifier) == 0) {
return input_config;
+ } else if (strcmp(input_config->identifier, "*") == 0) {
+ wildcard_config = input_config;
}
}
- return NULL;
+ return wildcard_config;
}