mirror of
https://github.com/swaywm/sway.git
synced 2024-11-27 02:11:28 +00:00
Fix swaybars with no defined output
This commit is contained in:
parent
eccfcde2eb
commit
3133d0c03c
|
@ -485,13 +485,13 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) {
|
||||||
json_object_object_add(json, "colors", colors);
|
json_object_object_add(json, "colors", colors);
|
||||||
|
|
||||||
// Add outputs if defined
|
// Add outputs if defined
|
||||||
json_object *outputs = json_object_new_array();
|
|
||||||
if (bar->outputs && bar->outputs->length > 0) {
|
if (bar->outputs && bar->outputs->length > 0) {
|
||||||
|
json_object *outputs = json_object_new_array();
|
||||||
for (int i = 0; i < bar->outputs->length; ++i) {
|
for (int i = 0; i < bar->outputs->length; ++i) {
|
||||||
const char *name = bar->outputs->items[i];
|
const char *name = bar->outputs->items[i];
|
||||||
json_object_array_add(outputs, json_object_new_string(name));
|
json_object_array_add(outputs, json_object_new_string(name));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
json_object_object_add(json, "outputs", outputs);
|
json_object_object_add(json, "outputs", outputs);
|
||||||
|
}
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue