diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-12-18 10:44:51 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-12-18 10:44:51 -0500 |
commit | 4c436a1a6f78ce9eae40791b85c02d44458de727 (patch) | |
tree | 64cb8fed2e33720ac6c1315e3ff8e205c50c1e08 /sway/input/input-manager.c | |
parent | 483ede0146cd5eb5b1a68dc365f99af0c66fd156 (diff) |
remove assumption of one device per identifier
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r-- | sway/input/input-manager.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 12a66917..52da8f5e 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c @@ -83,17 +83,6 @@ static struct sway_input_device *input_sway_device_from_wlr( return NULL; } -static struct sway_input_device *input_sway_device_from_config( - struct sway_input_manager *input, struct input_config *config) { - struct sway_input_device *input_device = NULL; - wl_list_for_each(input_device, &input->devices, link) { - if (strcmp(input_device->identifier, config->identifier) == 0) { - return input_device; - } - } - return NULL; -} - static bool input_has_seat_configuration(struct sway_input_manager *input) { struct sway_seat *seat = NULL; wl_list_for_each(seat, &input->seats, link) { @@ -238,16 +227,16 @@ void sway_input_manager_set_focus(struct sway_input_manager *input, void sway_input_manager_apply_input_config(struct sway_input_manager *input, struct input_config *input_config) { - struct sway_input_device *input_device = - input_sway_device_from_config(input, input_config); - if (!input_device) { - return; - } - input_device->config = input_config; + struct sway_input_device *input_device = NULL; + wl_list_for_each(input_device, &input->devices, link) { + if (strcmp(input_device->identifier, input_config->identifier) == 0) { + input_device->config = input_config; - struct sway_seat *seat = NULL; - wl_list_for_each(seat, &input->seats, link) { - sway_seat_configure_device(seat, input_device); + struct sway_seat *seat = NULL; + wl_list_for_each(seat, &input->seats, link) { + sway_seat_configure_device(seat, input_device); + } + } } } |