summaryrefslogtreecommitdiffstats
path: root/src/notify.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/notify.c')
-rw-r--r--src/notify.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/notify.c b/src/notify.c
index d7dc610..334468b 100644
--- a/src/notify.c
+++ b/src/notify.c
@@ -279,12 +279,14 @@ void notify_update_bar(void)
if (time_left > 0) {
int hours_left, minutes_left;
- hours_left = (time_left / HOURINSEC);
- minutes_left =
- (time_left -
- hours_left * HOURINSEC) / MININSEC;
- pthread_mutex_lock(&nbar.mutex);
+ /* In minutes rounded up. */
+ minutes_left = time_left / MININSEC +
+ (time_left % MININSEC ? 1 : 0);
+
+ hours_left = minutes_left / HOURINMIN;
+ minutes_left = minutes_left % HOURINMIN;
+ pthread_mutex_lock(&nbar.mutex);
blinking = time_left <= nbar.cntdwn && notify_trigger();
WINS_NBAR_LOCK;