diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-10-20 19:43:58 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-20 19:43:58 +1000 |
commit | cafb1ff4f78b0f093ab4da987174b92762696366 (patch) | |
tree | ebf10763935118bfe2fea732409c7c1b09c3faa8 | |
parent | Merge pull request #2870 from RyanDwyer/refactor-input-manager (diff) | |
parent | Fix crash when defaut seat is not created (diff) | |
download | sway-cafb1ff4f78b0f093ab4da987174b92762696366.tar.gz sway-cafb1ff4f78b0f093ab4da987174b92762696366.tar.zst sway-cafb1ff4f78b0f093ab4da987174b92762696366.zip |
Merge pull request #2890 from mihaicmn/create-default-seat
Fix crash when defaut seat is not created
-rw-r--r-- | sway/input/input-manager.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 5be4143f..91c45dd1 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -30,6 +30,10 @@ struct sway_seat *input_manager_current_seat(void) { | |||
30 | return seat; | 30 | return seat; |
31 | } | 31 | } |
32 | 32 | ||
33 | struct sway_seat *input_manager_get_default_seat(void) { | ||
34 | return input_manager_get_seat(DEFAULT_SEAT); | ||
35 | } | ||
36 | |||
33 | struct sway_seat *input_manager_get_seat(const char *seat_name) { | 37 | struct sway_seat *input_manager_get_seat(const char *seat_name) { |
34 | struct sway_seat *seat = NULL; | 38 | struct sway_seat *seat = NULL; |
35 | wl_list_for_each(seat, &server.input->seats, link) { | 39 | wl_list_for_each(seat, &server.input->seats, link) { |
@@ -294,7 +298,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) { | |||
294 | struct sway_seat *seat = NULL; | 298 | struct sway_seat *seat = NULL; |
295 | if (!input_has_seat_configuration()) { | 299 | if (!input_has_seat_configuration()) { |
296 | wlr_log(WLR_DEBUG, "no seat configuration, using default seat"); | 300 | wlr_log(WLR_DEBUG, "no seat configuration, using default seat"); |
297 | seat = input_manager_get_seat(DEFAULT_SEAT); | 301 | seat = input_manager_get_default_seat(); |
298 | seat_add_device(seat, input_device); | 302 | seat_add_device(seat, input_device); |
299 | return; | 303 | return; |
300 | } | 304 | } |
@@ -517,16 +521,6 @@ void input_manager_configure_xcursor(void) { | |||
517 | } | 521 | } |
518 | } | 522 | } |
519 | 523 | ||
520 | struct sway_seat *input_manager_get_default_seat(void) { | ||
521 | struct sway_seat *seat = NULL; | ||
522 | wl_list_for_each(seat, &server.input->seats, link) { | ||
523 | if (strcmp(seat->wlr_seat->name, DEFAULT_SEAT) == 0) { | ||
524 | return seat; | ||
525 | } | ||
526 | } | ||
527 | return seat; | ||
528 | } | ||
529 | |||
530 | struct input_config *input_device_get_config(struct sway_input_device *device) { | 524 | struct input_config *input_device_get_config(struct sway_input_device *device) { |
531 | struct input_config *wildcard_config = NULL; | 525 | struct input_config *wildcard_config = NULL; |
532 | struct input_config *input_config = NULL; | 526 | struct input_config *input_config = NULL; |