diff options
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c index 7d5999d8..a2f6a728 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -167,6 +167,16 @@ void free_pid_workspace(struct pid_workspace *pw) { | |||
167 | free(pw); | 167 | free(pw); |
168 | } | 168 | } |
169 | 169 | ||
170 | void free_command_policy(struct command_policy *policy) { | ||
171 | free(policy->command); | ||
172 | free(policy); | ||
173 | } | ||
174 | |||
175 | void free_feature_policy(struct feature_policy *policy) { | ||
176 | free(policy->program); | ||
177 | free(policy); | ||
178 | } | ||
179 | |||
170 | void free_config(struct sway_config *config) { | 180 | void free_config(struct sway_config *config) { |
171 | int i; | 181 | int i; |
172 | for (i = 0; i < config->symbols->length; ++i) { | 182 | for (i = 0; i < config->symbols->length; ++i) { |
@@ -211,6 +221,16 @@ void free_config(struct sway_config *config) { | |||
211 | } | 221 | } |
212 | list_free(config->output_configs); | 222 | list_free(config->output_configs); |
213 | 223 | ||
224 | for (i = 0; i < config->command_policies->length; ++i) { | ||
225 | free_command_policy(config->command_policies->items[i]); | ||
226 | } | ||
227 | list_free(config->command_policies); | ||
228 | |||
229 | for (i = 0; i < config->feature_policies->length; ++i) { | ||
230 | free_feature_policy(config->feature_policies->items[i]); | ||
231 | } | ||
232 | list_free(config->feature_policies); | ||
233 | |||
214 | list_free(config->active_bar_modifiers); | 234 | list_free(config->active_bar_modifiers); |
215 | free_flat_list(config->config_chain); | 235 | free_flat_list(config->config_chain); |
216 | free(config->font); | 236 | free(config->font); |
@@ -321,6 +341,10 @@ static void config_defaults(struct sway_config *config) { | |||
321 | config->border_colors.placeholder.child_border = 0x0C0C0CFF; | 341 | config->border_colors.placeholder.child_border = 0x0C0C0CFF; |
322 | 342 | ||
323 | config->border_colors.background = 0xFFFFFFFF; | 343 | config->border_colors.background = 0xFFFFFFFF; |
344 | |||
345 | // Security | ||
346 | config->command_policies = create_list(); | ||
347 | config->feature_policies = create_list(); | ||
324 | } | 348 | } |
325 | 349 | ||
326 | static int compare_modifiers(const void *left, const void *right) { | 350 | static int compare_modifiers(const void *left, const void *right) { |