diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-02-03 20:14:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-03 20:14:45 +0100 |
commit | 4ef5b49906700e25383a32cde0b16f1df2de250a (patch) | |
tree | 8e54c4ee9dd0ffceecf5a99f91a341fd1d714c5e /sway/input/input-manager.c | |
parent | 8e60efe0bf771120818b675d54c87b091c68fd70 (diff) | |
parent | 7299b9a6ca3658852f2ff41b05f6aaa86ff90d81 (diff) |
Merge pull request #3564 from RedSoxFan/seat-cursor-do-not-create
seat_cmd_cursor: do not create non-existing seat
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r-- | sway/input/input-manager.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 8d263e06..f99fc395 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c @@ -31,10 +31,10 @@ struct sway_seat *input_manager_current_seat(void) { } struct sway_seat *input_manager_get_default_seat(void) { - return input_manager_get_seat(DEFAULT_SEAT); + return input_manager_get_seat(DEFAULT_SEAT, true); } -struct sway_seat *input_manager_get_seat(const char *seat_name) { +struct sway_seat *input_manager_get_seat(const char *seat_name, bool create) { struct sway_seat *seat = NULL; wl_list_for_each(seat, &server.input->seats, link) { if (strcmp(seat->wlr_seat->name, seat_name) == 0) { @@ -42,7 +42,7 @@ struct sway_seat *input_manager_get_seat(const char *seat_name) { } } - return seat_create(seat_name); + return create ? seat_create(seat_name) : NULL; } char *input_device_get_identifier(struct wlr_input_device *device) { @@ -674,7 +674,8 @@ void input_manager_apply_seat_config(struct seat_config *seat_config) { seat_apply_config(seat, sc); } } else { - struct sway_seat *seat = input_manager_get_seat(seat_config->name); + struct sway_seat *seat = + input_manager_get_seat(seat_config->name, true); if (!seat) { return; } |