Skip to content

show_age_threshold does not handle suspend/resume #492

@blueyed

Description

@blueyed

When using show_age_threshold the time delta seems to not include time where the computer was suspended.

Relevant code:

dunst/src/notification.c

Lines 514 to 515 in 8735c9d

gint64 hours, minutes, seconds;
gint64 t_delta = g_get_monotonic_time() - n->timestamp;

From GLib:Date_and_Time_Functions(3):

   g_get_monotonic_time ()
           gint64              g_get_monotonic_time                (void);

       Queries the system monotonic time, if available.

       On POSIX systems with clock_gettime() and CLOCK_MONOTONIC this call is a very
       shallow wrapper for that. Otherwise, we make a best effort that probably involves
       returning the wall clock time (with at least microsecond accuracy, subject to the
       limitations of the OS kernel).

       It's important to note that POSIX CLOCK_MONOTONIC does not count time spent while
       the machine is suspended.

Side note: it would also be good to skip calculating t_delta altogether if show_age_threshold is not used.

  • Version: 1.3.1 (2018-01-30)
  • Distro and version: Arch Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions