Merge pull request #183 from nopjmp/stack-replace-fix

Notifcations that replace another still 'stack'
This commit is contained in:
Sascha Kruse 2014-06-17 13:40:14 +02:00
commit 131ff38e65

View File

@ -313,6 +313,13 @@ int notification_init(notification * n, int id)
n->msg = g_strstrip(n->msg); n->msg = g_strstrip(n->msg);
if (id == 0) {
n->id = ++next_notification_id;
} else {
notification_close_by_id(id, -1);
n->id = id;
}
n->dup_count = 0; n->dup_count = 0;
/* check if n is a duplicate */ /* check if n is a duplicate */
@ -402,13 +409,6 @@ int notification_init(notification * n, int id)
n->first_render = true; n->first_render = true;
if (id == 0) {
n->id = ++next_notification_id;
} else {
notification_close_by_id(id, -1);
n->id = id;
}
if (strlen(n->msg) == 0) { if (strlen(n->msg) == 0) {
notification_close(n, 2); notification_close(n, 2);
printf("skipping notification: %s %s\n", n->body, n->summary); printf("skipping notification: %s %s\n", n->body, n->summary);