diff options
author | Drew DeVault <[email protected]> | 2018-01-29 16:16:23 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2018-01-29 16:16:23 -0500 |
commit | 38903e580166b1fd4b55daa0c8b60d40f805f31c (patch) | |
tree | d74612bada10c8300d8c7f9ccdc16e57280cb03b /sway/config.c | |
parent | 0c58673c6a108ba241419a0f1d5fecd47f22370e (diff) | |
parent | 6259831d3168898a3f1560fb832106d194b582b4 (diff) |
Merge pull request #1555 from martinetd/cmd_reload
commands: add 'reload' command
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c index 1fd123b7..a67322d1 100644 --- a/sway/config.c +++ b/sway/config.c @@ -21,6 +21,7 @@ #endif #include <wlr/types/wlr_output.h> #include "sway/input/input-manager.h" +#include "sway/input/seat.h" #include "sway/commands.h" #include "sway/config.h" #include "sway/layout.h" @@ -109,6 +110,23 @@ void free_config(struct sway_config *config) { free(config); } +static void destroy_removed_seats(struct sway_config *old_config, + struct sway_config *new_config) { + struct seat_config *seat_config; + struct sway_seat *seat; + int i; + for (i = 0; i < old_config->seat_configs->length; i++) { + seat_config = old_config->seat_configs->items[i]; + /* Also destroy seats that aren't present in new config */ + if (new_config && list_seq_find(new_config->seat_configs, + seat_name_cmp, seat_config->name) < 0) { + seat = input_manager_get_seat(input_manager, + seat_config->name); + sway_seat_destroy(seat); + } + } +} + static void config_defaults(struct sway_config *config) { if (!(config->symbols = create_list())) goto cleanup; if (!(config->modes = create_list())) goto cleanup; @@ -382,6 +400,7 @@ bool load_main_config(const char *file, bool is_active) { } if (old_config) { + destroy_removed_seats(old_config, config); free_config(old_config); } config->reading = false; |