diff --git a/sway/config/bar.c b/sway/config/bar.c index 63facdef8..695ef6762 100644 --- a/sway/config/bar.c +++ b/sway/config/bar.c @@ -172,7 +172,9 @@ struct bar_config *default_bar_config(void) { bar->colors.binding_mode_text = NULL; #if HAVE_TRAY - bar->colors.tray_background = NULL; + if (!(bar->colors.tray_background = strndup("#00000000", 9))) { + goto cleanup; + } bar->tray_padding = 2; wl_list_init(&bar->tray_bindings); #endif diff --git a/sway/ipc-json.c b/sway/ipc-json.c index b834983c6..88faf937d 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -1405,13 +1405,8 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) { } #if HAVE_TRAY - if (bar->colors.tray_background) { - json_object_object_add(colors, "tray_background", - json_object_new_string(bar->colors.tray_background)); - } else { - json_object_object_add(colors, "tray_background", - json_object_new_string(bar->colors.background)); - } + json_object_object_add(colors, "tray_background", + json_object_new_string(bar->colors.tray_background)); #endif json_object_object_add(json, "colors", colors);