aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Pi-Yueh Chuang <pychuang@pm.me>2021-03-17 04:49:04 -0400
committerLibravatar GitHub <noreply@github.com>2021-03-17 09:49:04 +0100
commit6059c744f8b24ef3321eb7896991112366896e26 (patch)
tree0589d8bc080b9a0a42410d82117cd73b72449aa9
parentbuild: update version to v1.6-rc1 (diff)
downloadsway-6059c744f8b24ef3321eb7896991112366896e26.tar.gz
sway-6059c744f8b24ef3321eb7896991112366896e26.tar.zst
sway-6059c744f8b24ef3321eb7896991112366896e26.zip
swaybar: silence missing IconThemePath message
IconThemePath is not a standard property in XDG's StatusNotifierItem specification, so missing this property should not be logged as an error. This patch changes the log level to SWAY_DEBUG when swaybar queries the value of IconThemePath so that swaybar won't log the returned message as an error if IconThemePath does not exist. Closes: https://github.com/swaywm/sway/issues/6092
-rw-r--r--swaybar/tray/item.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/swaybar/tray/item.c b/swaybar/tray/item.c
index a5660f62..c9da51d4 100644
--- a/swaybar/tray/item.c
+++ b/swaybar/tray/item.c
@@ -118,8 +118,13 @@ static int get_property_callback(sd_bus_message *msg, void *data,
118 118
119 int ret; 119 int ret;
120 if (sd_bus_message_is_method_error(msg, NULL)) { 120 if (sd_bus_message_is_method_error(msg, NULL)) {
121 sway_log(SWAY_ERROR, "%s %s: %s", sni->watcher_id, prop, 121 const sd_bus_error *err = sd_bus_message_get_error(msg);
122 sd_bus_message_get_error(msg)->message); 122 sway_log_importance_t log_lv = SWAY_ERROR;
123 if ((!strcmp(prop, "IconThemePath")) &&
124 (!strcmp(err->name, SD_BUS_ERROR_UNKNOWN_PROPERTY))) {
125 log_lv = SWAY_DEBUG;
126 }
127 sway_log(log_lv, "%s %s: %s", sni->watcher_id, prop, err->message);
123 ret = sd_bus_message_get_errno(msg); 128 ret = sd_bus_message_get_errno(msg);
124 goto cleanup; 129 goto cleanup;
125 } 130 }