fix unreliable and missed timeouts
This commit is contained in:
parent
0b3599076b
commit
dab943a702
2
dunst.c
2
dunst.c
@ -193,7 +193,7 @@ static int get_sleep_time(void)
|
|||||||
|
|
||||||
max_age = MAX(max_age, notification_get_age(n));
|
max_age = MAX(max_age, notification_get_age(n));
|
||||||
int ttl = notification_get_ttl(n);
|
int ttl = notification_get_ttl(n);
|
||||||
if (ttl > 0) {
|
if (ttl >= 0) {
|
||||||
if (have_ttl) {
|
if (have_ttl) {
|
||||||
min_ttl = MIN(min_ttl, ttl);
|
min_ttl = MIN(min_ttl, ttl);
|
||||||
} else {
|
} else {
|
||||||
|
@ -520,7 +520,7 @@ void notification_update_text_to_render(notification *n)
|
|||||||
|
|
||||||
int notification_get_ttl(notification *n) {
|
int notification_get_ttl(notification *n) {
|
||||||
if (n->timeout == 0) {
|
if (n->timeout == 0) {
|
||||||
return 0;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
return n->timeout - (time(NULL) - n->start);
|
return n->timeout - (time(NULL) - n->start);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user