diff options
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r-- | sway/input/input-manager.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 26cf5035..bfe9d9c4 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -174,7 +174,8 @@ static void input_add_notify(struct wl_listener *listener, void *data) { | |||
174 | for (int i = 0; i < config->input_configs->length; ++i) { | 174 | for (int i = 0; i < config->input_configs->length; ++i) { |
175 | struct input_config *input_config = config->input_configs->items[i]; | 175 | struct input_config *input_config = config->input_configs->items[i]; |
176 | if (strcmp(input_config->identifier, input_device->identifier) == 0) { | 176 | if (strcmp(input_config->identifier, input_device->identifier) == 0) { |
177 | input_device->config = input_config; | 177 | free_input_config(input_device->config); |
178 | input_device->config = copy_input_config(input_config); | ||
178 | break; | 179 | break; |
179 | } | 180 | } |
180 | } | 181 | } |
@@ -240,6 +241,7 @@ static void input_remove_notify(struct wl_listener *listener, void *data) { | |||
240 | } | 241 | } |
241 | 242 | ||
242 | wl_list_remove(&input_device->link); | 243 | wl_list_remove(&input_device->link); |
244 | free_input_config(input_device->config); | ||
243 | free(input_device->identifier); | 245 | free(input_device->identifier); |
244 | free(input_device); | 246 | free(input_device); |
245 | } | 247 | } |
@@ -293,7 +295,8 @@ void sway_input_manager_apply_input_config(struct sway_input_manager *input, | |||
293 | struct sway_input_device *input_device = NULL; | 295 | struct sway_input_device *input_device = NULL; |
294 | wl_list_for_each(input_device, &input->devices, link) { | 296 | wl_list_for_each(input_device, &input->devices, link) { |
295 | if (strcmp(input_device->identifier, input_config->identifier) == 0) { | 297 | if (strcmp(input_device->identifier, input_config->identifier) == 0) { |
296 | input_device->config = input_config; | 298 | free_input_config(input_device->config); |
299 | input_device->config = copy_input_config(input_config); | ||
297 | 300 | ||
298 | if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER) { | 301 | if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER) { |
299 | sway_input_manager_libinput_config_pointer(input_device); | 302 | sway_input_manager_libinput_config_pointer(input_device); |