use #00000000 as default tray background

this ensures, that the tray background is equal to bar background
if tray background is not set and background color is neither
fully opaque or transparent
This commit is contained in:
Bonsaiiv 2026-02-14 18:18:20 +01:00
parent 49d8cf1d94
commit 0a6027968a
2 changed files with 5 additions and 8 deletions

View file

@ -172,7 +172,9 @@ struct bar_config *default_bar_config(void) {
bar->colors.binding_mode_text = NULL; bar->colors.binding_mode_text = NULL;
#if HAVE_TRAY #if HAVE_TRAY
bar->colors.tray_background = NULL; if (!(bar->colors.tray_background = strndup("#00000000", 9))) {
goto cleanup;
}
bar->tray_padding = 2; bar->tray_padding = 2;
wl_list_init(&bar->tray_bindings); wl_list_init(&bar->tray_bindings);
#endif #endif

View file

@ -1405,13 +1405,8 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) {
} }
#if HAVE_TRAY #if HAVE_TRAY
if (bar->colors.tray_background) {
json_object_object_add(colors, "tray_background", json_object_object_add(colors, "tray_background",
json_object_new_string(bar->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));
}
#endif #endif
json_object_object_add(json, "colors", colors); json_object_object_add(json, "colors", colors);