aboutsummaryrefslogtreecommitdiff
path: root/swaybar/ipc.c
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2016-09-17 17:25:45 +1000
committerFurkan Sahin <furkan-dev@proton.me>2016-09-17 17:25:45 +1000
commit297b9665cd3b1df4bca48c55a9264bb228c0f078 (patch)
tree1c96a901a341a314be49844080fdb813b2e7f8b5 /swaybar/ipc.c
parent1c06ffd11210c794a05e923580224f7eac5bed20 (diff)
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 'swaybar/ipc.c')
-rw-r--r--swaybar/ipc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/swaybar/ipc.c b/swaybar/ipc.c
index bce9dc79..2c092853 100644
--- a/swaybar/ipc.c
+++ b/swaybar/ipc.c
@@ -278,7 +278,7 @@ void ipc_bar_init(struct bar *bar, const char *bar_id) {
} else {
int j = 0;
for (j = 0; j < bar->config->outputs->length; ++j) {
- const char *conf_name = bar->config->outputs->items[i];
+ const char *conf_name = bar->config->outputs->items[j];
if (strcasecmp(name, conf_name) == 0) {
use_output = true;
break;