Tidy up spec a bit, fix code to set timeout in notify-send

This commit is contained in:
Mike Hearn 2004-07-14 00:08:12 +00:00
parent 6ba11f0bdb
commit 2f45073df4
2 changed files with 6 additions and 4 deletions

View File

@ -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 code. This code will be reported back to the client if the action
is invoked by the user. 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 It returns a UINT32 that will never be reused within a
session unless more than MAXINT notifications have been generated session unless more than MAXINT notifications have been generated

View File

@ -38,7 +38,7 @@ main(int argc, const char **argv)
gchar *icon_str = NULL; gchar *icon_str = NULL;
NotifyIcon *icon = NULL; NotifyIcon *icon = NULL;
NotifyUrgency urgency = NOTIFY_URGENCY_NORMAL; NotifyUrgency urgency = NOTIFY_URGENCY_NORMAL;
time_t expire_time; time_t expire_time = 0;
char ch; char ch;
poptContext opt_ctx; poptContext opt_ctx;
const char **args; 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 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, notify_send_notification(0, urgency, summary, description, icon,
TRUE, expire_time, NULL, 0); TRUE, expire_time, NULL, 0);