From 0a6027968ad5d0f97c7774ca01b07293b35f06fc Mon Sep 17 00:00:00 2001 From: Bonsaiiv Date: Sat, 14 Feb 2026 18:18:20 +0100 Subject: [PATCH] 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 --- sway/config/bar.c | 4 +++- sway/ipc-json.c | 9 ++------- 2 files changed, 5 insertions(+), 8 deletions(-) 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);