diff --git a/CHANGELOG.md b/CHANGELOG.md index f8ee104..fb97a72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +### Fixed +- `new_icon` rule being ignored on notifications that had a raw icon + ## 1.2.0 - 2017-07-12 ### Added diff --git a/src/notification.h b/src/notification.h index e5731a8..df64d08 100644 --- a/src/notification.h +++ b/src/notification.h @@ -34,6 +34,7 @@ typedef struct _notification { char *appname; char *summary; char *body; + bool icon_overridden; char *icon; RawImage *raw_icon; char *msg; /* formatted message */ diff --git a/src/rules.c b/src/rules.c index a40fc55..6cc6871 100644 --- a/src/rules.c +++ b/src/rules.c @@ -24,6 +24,7 @@ void rule_apply(rule_t * r, notification * n) if(n->icon) g_free(n->icon); n->icon = g_strdup(r->new_icon); + n->icon_overridden = true; } if (r->fg) n->color_strings[ColFG] = r->fg; diff --git a/src/x11/x.c b/src/x11/x.c index 9f7ac20..57ca7b3 100644 --- a/src/x11/x.c +++ b/src/x11/x.c @@ -408,8 +408,11 @@ static colored_layout *r_init_shared(cairo_t *c, notification *n) GdkPixbuf *pixbuf = NULL; - if (n->raw_icon && settings.icon_position != icons_off) { + if (n->raw_icon && !n->icon_overridden && + settings.icon_position != icons_off) { + pixbuf = get_pixbuf_from_raw_image(n->raw_icon); + } else if (n->icon && settings.icon_position != icons_off) { pixbuf = get_pixbuf_from_path(n->icon); }