aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2016-09-17 17:25:45 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2016-09-17 17:25:45 +1000
commite4cb4d1b5cd32e9455243ee7138bf007343269c2 (patch)
tree1c96a901a341a314be49844080fdb813b2e7f8b5 /sway
parentMerge pull request #902 from zandrmartin/patch-2 (diff)
downloadsway-e4cb4d1b5cd32e9455243ee7138bf007343269c2.tar.gz
sway-e4cb4d1b5cd32e9455243ee7138bf007343269c2.tar.zst
sway-e4cb4d1b5cd32e9455243ee7138bf007343269c2.zip
Fix swaybar when running on named outputs.
When using a bar on a named output, load_swaybars() requires the output to be active (ie. in the root container), but this is not the case if the bar is added to the last output. To fix this, load_swaybars() is now called after the output has been added to the root container. After fixing that, swaybar would segfault due to using the wrong index variable when loading outputs and config.
Diffstat (limited to 'sway')
-rw-r--r--sway/config.c3
-rw-r--r--sway/container.c1
2 files changed, 1 insertions, 3 deletions
diff --git a/sway/config.c b/sway/config.c
index a187fe3e..c0fbd210 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -936,9 +936,6 @@ void apply_output_config(struct output_config *oc, swayc_t *output) {
936 execvp(cmd[0], cmd); 936 execvp(cmd[0], cmd);
937 } 937 }
938 } 938 }
939
940 // reload swaybars
941 load_swaybars();
942} 939}
943 940
944char *do_var_replacement(char *str) { 941char *do_var_replacement(char *str) {
diff --git a/sway/container.c b/sway/container.c
index 5614293c..561dcba6 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -156,6 +156,7 @@ swayc_t *new_output(wlc_handle handle) {
156 156
157 apply_output_config(oc, output); 157 apply_output_config(oc, output);
158 add_child(&root_container, output); 158 add_child(&root_container, output);
159 load_swaybars();
159 160
160 // Create workspace 161 // Create workspace
161 char *ws_name = NULL; 162 char *ws_name = NULL;