diff -Nru notify-osd-0.9.35+16.04.20160413/debian/changelog notify-osd-0.9.35+16.04.20160415/debian/changelog --- notify-osd-0.9.35+16.04.20160413/debian/changelog 2016-04-15 12:00:35.000000000 +0000 +++ notify-osd-0.9.35+16.04.20160415/debian/changelog 2016-04-15 12:00:35.000000000 +0000 @@ -1,3 +1,10 @@ +notify-osd (0.9.35+16.04.20160415-0ubuntu1) xenial; urgency=medium + + * Stack: allow to replace a notification when the replace_id has been + provided (LP: #1569682) + + -- Marco Trevisan (TreviƱo) Fri, 15 Apr 2016 11:58:40 +0000 + notify-osd (0.9.35+16.04.20160413-0ubuntu1) xenial; urgency=medium * Stack: allow to replace a notification when the replace_id has been diff -Nru notify-osd-0.9.35+16.04.20160413/src/bubble.c notify-osd-0.9.35+16.04.20160415/src/bubble.c --- notify-osd-0.9.35+16.04.20160413/src/bubble.c 2016-04-13 05:36:12.000000000 +0000 +++ notify-osd-0.9.35+16.04.20160415/src/bubble.c 2016-04-15 11:58:38.000000000 +0000 @@ -2323,6 +2323,7 @@ // filter out any HTML/markup if possible text = filter_text (body); + g_strstrip (text); if (priv->message_body) if (g_strcmp0 (priv->message_body->str, text)) @@ -3766,7 +3767,36 @@ if (text) { + g_strstrip (text); + + if (text[0] == '\0') + { + if (priv->message_body->len > 0 && + priv->message_body->str[priv->message_body->len-1] != '\n') + { + // This is a special combination, that allows us to remember that a + // new empty body line has been requested, but we won't show this till + // something visible will be appended. + g_string_append_c (priv->message_body, '\0'); + g_string_append_c (priv->message_body, '\n'); + } + + g_free (text); + return; + } + + if (priv->message_body->len > 1) + { + if (priv->message_body->str[priv->message_body->len-1] == '\n' && + priv->message_body->str[priv->message_body->len-2] == '\0') + { + // A new message has been appended, let's remove the \0 we put before. + g_string_erase (priv->message_body, priv->message_body->len-2, 1); + } + } + // append text to current message-body + g_string_append_c (priv->message_body, '\n'); g_string_append (priv->message_body, text); priv->message_body_needs_refresh = TRUE; diff -Nru notify-osd-0.9.35+16.04.20160413/src/stack.c notify-osd-0.9.35+16.04.20160415/src/stack.c --- notify-osd-0.9.35+16.04.20160413/src/stack.c 2016-04-13 05:36:17.000000000 +0000 +++ notify-osd-0.9.35+16.04.20160415/src/stack.c 2016-04-15 11:58:38.000000000 +0000 @@ -682,7 +682,6 @@ g_object_unref(bubble); bubble = app_bubble; if (body) { - bubble_append_message_body (bubble, "\n"); bubble_append_message_body (bubble, body); } }