Tidy up spec a bit, fix code to set timeout in notify-send
This commit is contained in:
parent
6ba11f0bdb
commit
2f45073df4
|
@ -246,7 +246,9 @@ The following messages must be supported by all implementations.
|
|||
code. This code will be reported back to the client if the action
|
||||
is invoked by the user.
|
||||
|
||||
UINT32/NIL expire time: if nil the notification never times out
|
||||
UINT32/NIL expire time: if nil the notification never times out.
|
||||
If non-nil, a UNIX time_t (since the epoch) at which point the notification
|
||||
will be automatically closed. If zero, use the default server timeout.
|
||||
|
||||
It returns a UINT32 that will never be reused within a
|
||||
session unless more than MAXINT notifications have been generated
|
||||
|
|
|
@ -38,7 +38,7 @@ main(int argc, const char **argv)
|
|||
gchar *icon_str = NULL;
|
||||
NotifyIcon *icon = NULL;
|
||||
NotifyUrgency urgency = NOTIFY_URGENCY_NORMAL;
|
||||
time_t expire_time;
|
||||
time_t expire_time = 0;
|
||||
char ch;
|
||||
poptContext opt_ctx;
|
||||
const char **args;
|
||||
|
@ -128,8 +128,8 @@ main(int argc, const char **argv)
|
|||
}
|
||||
|
||||
/* if the given time is < current time, treat it as a timeout in seconds (ie 5 seconds) */
|
||||
if (expire_time < time(NULL)) expire_time += time(NULL);
|
||||
|
||||
if (expire_time && expire_time < time(NULL)) expire_time += time(NULL);
|
||||
|
||||
notify_send_notification(0, urgency, summary, description, icon,
|
||||
TRUE, expire_time, NULL, 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue