diff --git a/notification.c b/notification.c index 10cbd11..cfe086e 100644 --- a/notification.c +++ b/notification.c @@ -359,6 +359,8 @@ int notification_init(notification * n, int id) n->redisplayed = false; + n->first_render = true; + if (id == 0) { n->id = ++next_notification_id; } else { diff --git a/notification.h b/notification.h index 5c7a202..75961ef 100644 --- a/notification.h +++ b/notification.h @@ -31,6 +31,7 @@ typedef struct _notification { int dup_count; int displayed_height; const char *color_strings[2]; + bool first_render; int progress; /* percentage + 1, 0 to hide */ int line_count; diff --git a/x.c b/x.c index 1a4d154..e149f5c 100644 --- a/x.c +++ b/x.c @@ -301,7 +301,9 @@ static colored_layout *r_create_layout_from_notification(cairo_t *c, notificatio cl->text = NULL; cl->attr = NULL; pango_layout_set_text(cl->l, n->text_to_render, -1); - printf("Error parsing markup: %s\n", err->message); + if (n->first_render) { + printf("Error parsing markup: %s\n", err->message); + } g_error_free(err); } @@ -309,6 +311,7 @@ static colored_layout *r_create_layout_from_notification(cairo_t *c, notificatio pango_layout_get_pixel_size(cl->l, NULL, &(n->displayed_height)); n->displayed_height += 2 * settings.padding; + n->first_render = false; return cl; }