aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/input/input-manager.c29
-rw-r--r--sway/input/keyboard.c2
2 files changed, 11 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
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index ce0df3c5..bb18edd2 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -91,6 +91,8 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) {
91 wlr_keyboard_set_keymap(wlr_device->keyboard, keyboard->keymap); 91 wlr_keyboard_set_keymap(wlr_device->keyboard, keyboard->keymap);
92 wlr_keyboard_set_repeat_info(wlr_device->keyboard, 25, 600); 92 wlr_keyboard_set_repeat_info(wlr_device->keyboard, 25, 600);
93 xkb_context_unref(context); 93 xkb_context_unref(context);
94 struct wlr_seat *seat = keyboard->seat_device->sway_seat->wlr_seat;
95 wlr_seat_set_keyboard(seat, wlr_device);
94 96
95 wl_list_remove(&keyboard->keyboard_key.link); 97 wl_list_remove(&keyboard->keyboard_key.link);
96 wl_signal_add(&wlr_device->keyboard->events.key, &keyboard->keyboard_key); 98 wl_signal_add(&wlr_device->keyboard->events.key, &keyboard->keyboard_key);