aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/config.h
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-28 21:58:23 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-28 22:35:38 +1000
commit138d10d5d62a25c2e00bd9051c835b9e78a36de4 (patch)
treed967c524a4016695a48a48534ee3dac17c28e038 /include/sway/config.h
parentMerge pull request #2720 from swaywm/swaylock-shadow (diff)
downloadsway-138d10d5d62a25c2e00bd9051c835b9e78a36de4.tar.gz
sway-138d10d5d62a25c2e00bd9051c835b9e78a36de4.tar.zst
sway-138d10d5d62a25c2e00bd9051c835b9e78a36de4.zip
Rename workspace_outputs to workspace_configs and fix memory leak
When we eventually implement `workspace <ws> gaps inner|outer <px>`, we'll need to store the gaps settings for workspaces before they're created. Rather than create a workspace_gaps struct, the approach I'm taking is to rename workspace_outputs to workspace_configs and then add gaps settings to that. I've added a lookup function workspace_find_config. Note that we have a similar thing for outputs (output_config struct and output_find_config). Lastly, when freeing config it would create a memory leak by freeing the list items but not the workspace or output names inside them. This has been rectified using a free_workspace_config function.
Diffstat (limited to 'include/sway/config.h')
-rw-r--r--include/sway/config.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index 35f0e708..af5c7a18 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -167,13 +167,12 @@ struct output_config {
167}; 167};
168 168
169/** 169/**
170 * Maps a workspace name to an output name. 170 * Stores configuration for a workspace, regardless of whether the workspace
171 * 171 * exists.
172 * Set via `workspace <x> output <y>`
173 */ 172 */
174struct workspace_output { 173struct workspace_config {
175 char *output;
176 char *workspace; 174 char *workspace;
175 char *output;
177}; 176};
178 177
179struct bar_config { 178struct bar_config {
@@ -327,7 +326,7 @@ struct sway_config {
327 list_t *modes; 326 list_t *modes;
328 list_t *bars; 327 list_t *bars;
329 list_t *cmd_queue; 328 list_t *cmd_queue;
330 list_t *workspace_outputs; 329 list_t *workspace_configs;
331 list_t *output_configs; 330 list_t *output_configs;
332 list_t *input_configs; 331 list_t *input_configs;
333 list_t *seat_configs; 332 list_t *seat_configs;
@@ -518,6 +517,8 @@ struct bar_config *default_bar_config(void);
518 517
519void free_bar_config(struct bar_config *bar); 518void free_bar_config(struct bar_config *bar);
520 519
520void free_workspace_config(struct workspace_config *wsc);
521
521/** 522/**
522 * Updates the value of config->font_height based on the max title height 523 * Updates the value of config->font_height based on the max title height
523 * reported by each container. If recalculate is true, the containers will 524 * reported by each container. If recalculate is true, the containers will