diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-12-17 10:44:53 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-12-17 10:44:53 -0500 |
commit | a27736adcdfe01c5232adce58201463df34da5e7 (patch) | |
tree | 329b545de2aca3c79801907bb7d80b75df58f8d3 /sway | |
parent | seat fallback config (diff) | |
download | sway-a27736adcdfe01c5232adce58201463df34da5e7.tar.gz sway-a27736adcdfe01c5232adce58201463df34da5e7.tar.zst sway-a27736adcdfe01c5232adce58201463df34da5e7.zip |
cleanup input-manager
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/input-manager.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 16301489..12a66917 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -94,17 +94,6 @@ static struct sway_input_device *input_sway_device_from_config( | |||
94 | return NULL; | 94 | return NULL; |
95 | } | 95 | } |
96 | 96 | ||
97 | static struct sway_input_device *input_sway_device_from_identifier( | ||
98 | struct sway_input_manager *input, char *identifier) { | ||
99 | struct sway_input_device *input_device = NULL; | ||
100 | wl_list_for_each(input_device, &input->devices, link) { | ||
101 | if (strcmp(input_device->identifier, identifier) == 0) { | ||
102 | return input_device; | ||
103 | } | ||
104 | } | ||
105 | return NULL; | ||
106 | } | ||
107 | |||
108 | static bool input_has_seat_configuration(struct sway_input_manager *input) { | 97 | static bool input_has_seat_configuration(struct sway_input_manager *input) { |
109 | struct sway_seat *seat = NULL; | 98 | struct sway_seat *seat = NULL; |
110 | wl_list_for_each(seat, &input->seats, link) { | 99 | wl_list_for_each(seat, &input->seats, link) { |
@@ -154,7 +143,8 @@ static void input_add_notify(struct wl_listener *listener, void *data) { | |||
154 | bool added = false; | 143 | bool added = false; |
155 | wl_list_for_each(seat, &input->seats, link) { | 144 | wl_list_for_each(seat, &input->seats, link) { |
156 | if (seat->config && | 145 | if (seat->config && |
157 | (seat_config_get_attachment(seat->config, input_device->identifier) || | 146 | (seat_config_get_attachment(seat->config, |
147 | input_device->identifier) || | ||
158 | seat_config_get_attachment(seat->config, "*"))) { | 148 | seat_config_get_attachment(seat->config, "*"))) { |
159 | sway_seat_add_device(seat, input_device); | 149 | sway_seat_add_device(seat, input_device); |
160 | added = true; | 150 | added = true; |
@@ -263,7 +253,8 @@ void sway_input_manager_apply_input_config(struct sway_input_manager *input, | |||
263 | 253 | ||
264 | void sway_input_manager_apply_seat_config(struct sway_input_manager *input, | 254 | void sway_input_manager_apply_seat_config(struct sway_input_manager *input, |
265 | struct seat_config *seat_config) { | 255 | struct seat_config *seat_config) { |
266 | sway_log(L_DEBUG, "applying new seat config for seat %s", seat_config->name); | 256 | sway_log(L_DEBUG, "applying new seat config for seat %s", |
257 | seat_config->name); | ||
267 | struct sway_seat *seat = input_manager_get_seat(input, seat_config->name); | 258 | struct sway_seat *seat = input_manager_get_seat(input, seat_config->name); |
268 | if (!seat) { | 259 | if (!seat) { |
269 | return; | 260 | return; |
@@ -282,7 +273,8 @@ void sway_input_manager_apply_seat_config(struct sway_input_manager *input, | |||
282 | continue; | 273 | continue; |
283 | } | 274 | } |
284 | if (seat_config_get_attachment(seat->config, "*") || | 275 | if (seat_config_get_attachment(seat->config, "*") || |
285 | seat_config_get_attachment(seat->config, input_device->identifier)) { | 276 | seat_config_get_attachment(seat->config, |
277 | input_device->identifier)) { | ||
286 | list_add(seat_list, seat); | 278 | list_add(seat_list, seat); |
287 | } | 279 | } |
288 | } | 280 | } |
@@ -311,6 +303,7 @@ void sway_input_manager_apply_seat_config(struct sway_input_manager *input, | |||
311 | } | 303 | } |
312 | } | 304 | } |
313 | } | 305 | } |
306 | list_free(seat_list); | ||
314 | } | 307 | } |
315 | } | 308 | } |
316 | 309 | ||