diff options
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r-- | sway/input/input-manager.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 055f6752..9aaeb4d6 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -95,6 +95,17 @@ static bool input_has_seat_fallback_configuration(void) { | |||
95 | return false; | 95 | return false; |
96 | } | 96 | } |
97 | 97 | ||
98 | void input_manager_verify_fallback_seat(void) { | ||
99 | struct sway_seat *seat = NULL; | ||
100 | if (!input_has_seat_fallback_configuration()) { | ||
101 | wlr_log(WLR_DEBUG, "no fallback seat config - creating default"); | ||
102 | seat = input_manager_get_default_seat(); | ||
103 | struct seat_config *sc = new_seat_config(seat->wlr_seat->name); | ||
104 | sc->fallback = true; | ||
105 | store_seat_config(sc); | ||
106 | } | ||
107 | } | ||
108 | |||
98 | static void input_manager_libinput_config_keyboard( | 109 | static void input_manager_libinput_config_keyboard( |
99 | struct sway_input_device *input_device) { | 110 | struct sway_input_device *input_device) { |
100 | struct wlr_input_device *wlr_device = input_device->wlr_device; | 111 | struct wlr_input_device *wlr_device = input_device->wlr_device; |
@@ -296,16 +307,10 @@ static void handle_new_input(struct wl_listener *listener, void *data) { | |||
296 | wl_signal_add(&device->events.destroy, &input_device->device_destroy); | 307 | wl_signal_add(&device->events.destroy, &input_device->device_destroy); |
297 | input_device->device_destroy.notify = handle_device_destroy; | 308 | input_device->device_destroy.notify = handle_device_destroy; |
298 | 309 | ||
299 | struct sway_seat *seat = NULL; | 310 | input_manager_verify_fallback_seat(); |
300 | if (!input_has_seat_fallback_configuration()) { | ||
301 | wlr_log(WLR_DEBUG, "no seat config - creating default seat config"); | ||
302 | seat = input_manager_get_default_seat(); | ||
303 | struct seat_config *sc = new_seat_config(seat->wlr_seat->name); | ||
304 | sc->fallback = true; | ||
305 | store_seat_config(sc); | ||
306 | } | ||
307 | 311 | ||
308 | bool added = false; | 312 | bool added = false; |
313 | struct sway_seat *seat = NULL; | ||
309 | wl_list_for_each(seat, &input->seats, link) { | 314 | wl_list_for_each(seat, &input->seats, link) { |
310 | struct seat_config *seat_config = seat_get_config(seat); | 315 | struct seat_config *seat_config = seat_get_config(seat); |
311 | bool has_attachment = seat_config && | 316 | bool has_attachment = seat_config && |