aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/input-manager.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-18 10:44:51 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-18 10:44:51 -0500
commit4c436a1a6f78ce9eae40791b85c02d44458de727 (patch)
tree64cb8fed2e33720ac6c1315e3ff8e205c50c1e08 /sway/input/input-manager.c
parentimprove xkb command logging (diff)
downloadsway-4c436a1a6f78ce9eae40791b85c02d44458de727.tar.gz
sway-4c436a1a6f78ce9eae40791b85c02d44458de727.tar.zst
sway-4c436a1a6f78ce9eae40791b85c02d44458de727.zip
remove assumption of one device per identifier
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r--sway/input/input-manager.c29
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(
83 return NULL; 83 return NULL;
84} 84}
85 85
86static struct sway_input_device *input_sway_device_from_config(
87 struct sway_input_manager *input, struct input_config *config) {
88 struct sway_input_device *input_device = NULL;
89 wl_list_for_each(input_device, &input->devices, link) {
90 if (strcmp(input_device->identifier, config->identifier) == 0) {
91 return input_device;
92 }
93 }
94 return NULL;
95}
96
97static bool input_has_seat_configuration(struct sway_input_manager *input) { 86static bool input_has_seat_configuration(struct sway_input_manager *input) {
98 struct sway_seat *seat = NULL; 87 struct sway_seat *seat = NULL;
99 wl_list_for_each(seat, &input->seats, link) { 88 wl_list_for_each(seat, &input->seats, link) {
@@ -238,16 +227,16 @@ void sway_input_manager_set_focus(struct sway_input_manager *input,
238 227
239void sway_input_manager_apply_input_config(struct sway_input_manager *input, 228void sway_input_manager_apply_input_config(struct sway_input_manager *input,
240 struct input_config *input_config) { 229 struct input_config *input_config) {
241 struct sway_input_device *input_device = 230 struct sway_input_device *input_device = NULL;
242 input_sway_device_from_config(input, input_config); 231 wl_list_for_each(input_device, &input->devices, link) {
243 if (!input_device) { 232 if (strcmp(input_device->identifier, input_config->identifier) == 0) {
244 return; 233 input_device->config = input_config;
245 }
246 input_device->config = input_config;
247 234
248 struct sway_seat *seat = NULL; 235 struct sway_seat *seat = NULL;
249 wl_list_for_each(seat, &input->seats, link) { 236 wl_list_for_each(seat, &input->seats, link) {
250 sway_seat_configure_device(seat, input_device); 237 sway_seat_configure_device(seat, input_device);
238 }
239 }
251 } 240 }
252} 241}
253 242