diff options
author | emersion <contact@emersion.fr> | 2018-09-24 10:43:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-24 10:43:18 +0200 |
commit | a032925ae7667e917f2bd8d1b77de97b400b3bf7 (patch) | |
tree | d5a6fffc3470b3fbbb18a6ae01851451bea1dbb2 /sway/input | |
parent | 4a4f07ac25d18dfeffc6a1ff55e175ba01abc290 (diff) | |
parent | baeb28ea6230ef9aa409ee52abe208720120e45c (diff) |
Merge pull request #2701 from RedSoxFan/input-wildcard
Implement support for input wildcard
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/input-manager.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index b4352c6a..f696646f 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c @@ -389,8 +389,10 @@ 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 (strcmp(input_device->identifier, input_config->identifier) == 0 + || wildcard) { if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER) { input_manager_libinput_config_pointer(input_device); } @@ -480,13 +482,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; } |