diff options
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r-- | sway/input/input-manager.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 055f6752..61087733 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -95,6 +95,18 @@ 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 | sc = store_seat_config(sc); | ||
106 | input_manager_apply_seat_config(sc); | ||
107 | } | ||
108 | } | ||
109 | |||
98 | static void input_manager_libinput_config_keyboard( | 110 | static void input_manager_libinput_config_keyboard( |
99 | struct sway_input_device *input_device) { | 111 | struct sway_input_device *input_device) { |
100 | struct wlr_input_device *wlr_device = input_device->wlr_device; | 112 | struct wlr_input_device *wlr_device = input_device->wlr_device; |
@@ -296,16 +308,10 @@ static void handle_new_input(struct wl_listener *listener, void *data) { | |||
296 | wl_signal_add(&device->events.destroy, &input_device->device_destroy); | 308 | wl_signal_add(&device->events.destroy, &input_device->device_destroy); |
297 | input_device->device_destroy.notify = handle_device_destroy; | 309 | input_device->device_destroy.notify = handle_device_destroy; |
298 | 310 | ||
299 | struct sway_seat *seat = NULL; | 311 | 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 | 312 | ||
308 | bool added = false; | 313 | bool added = false; |
314 | struct sway_seat *seat = NULL; | ||
309 | wl_list_for_each(seat, &input->seats, link) { | 315 | wl_list_for_each(seat, &input->seats, link) { |
310 | struct seat_config *seat_config = seat_get_config(seat); | 316 | struct seat_config *seat_config = seat_get_config(seat); |
311 | bool has_attachment = seat_config && | 317 | bool has_attachment = seat_config && |