diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-02-03 13:56:05 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-02-11 10:15:00 -0500 |
commit | 4272bf127439a2d8515e934821a9744537260b9d (patch) | |
tree | 30972bfd6f93afc9ac339b3ae89c1aedbe509c11 /sway/config.c | |
parent | Focus ws inactive node with focus_follows_mouse (diff) | |
download | sway-4272bf127439a2d8515e934821a9744537260b9d.tar.gz sway-4272bf127439a2d8515e934821a9744537260b9d.tar.zst sway-4272bf127439a2d8515e934821a9744537260b9d.zip |
seat_cmd_cursor: do not create non-existing seat
If a seat does not exist in seat_cmd_cursor, do not create it. A seat
without any attachments is useless since it will have no capabilities.
This changes `input_manager_get_seat` to have an additional argument
that dictates whether or not to create the seat if it does not exist.
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sway/config.c b/sway/config.c index 54d29fc9..ee1c42df 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -149,8 +149,10 @@ static void destroy_removed_seats(struct sway_config *old_config, | |||
149 | /* Also destroy seats that aren't present in new config */ | 149 | /* Also destroy seats that aren't present in new config */ |
150 | if (new_config && list_seq_find(new_config->seat_configs, | 150 | if (new_config && list_seq_find(new_config->seat_configs, |
151 | seat_name_cmp, seat_config->name) < 0) { | 151 | seat_name_cmp, seat_config->name) < 0) { |
152 | seat = input_manager_get_seat(seat_config->name); | 152 | seat = input_manager_get_seat(seat_config->name, false); |
153 | seat_destroy(seat); | 153 | if (seat) { |
154 | seat_destroy(seat); | ||
155 | } | ||
154 | } | 156 | } |
155 | } | 157 | } |
156 | } | 158 | } |