After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701645 - set_timeout method of Notification instance doesn’t have any effect
set_timeout method of Notification instance doesn’t have any effect
Status: RESOLVED NOTABUG
Product: gnome-shell
Classification: Core
Component: message-tray
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-06-05 13:04 UTC by Matěj Cepl
Modified: 2013-06-17 09:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
reproducer (481 bytes, text/x-python)
2013-06-05 13:04 UTC, Matěj Cepl
Details

Description Matěj Cepl 2013-06-05 13:04:06 UTC
Created attachment 246069 [details]
reproducer

Description of problem:
When running the attached script the notification hides after roughly five seconds (which is default, right?). Using Ctrl-C (and obtained time measurement) I can clearly see that the script runs more than 5s and less than 12s even after the notifications hides.

From looking at gnome-shell/us/js/notificationDaemon.js it seems to me that the timeout parameter is on line 412 assigned to ndata object, but I cannot find anywhere in the rest of gnome-shell that this parameter would be used (the code of messageTray.js is so convoluted, that I am not sure I haven't lost it somewhere though).

Version-Release number of selected component (if applicable):
libnotify-0.7.5-5.el7.x86_64
gnome-shell-3.8.2-4.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.run the attached script

Actual results:
notification hides after roughly 5s

Expected results:
it should hide exactly (more or less) after 12s

Additional info:
BTW, I see also bug 658189, which describes exactly the same behavior against notification-daemon. Not sure what it means, just noticing it.
Also, filed as Red Hat bug https://bugzilla.redhat.com/show_bug.cgi?id=971006
Comment 1 Florian Müllner 2013-06-05 13:18:15 UTC
I'm pretty sure we ignore this intentionally (at least that's what I always assumed), but let's ask Jon ...
Comment 2 Matěj Cepl 2013-06-05 14:00:33 UTC
(In reply to comment #1)
> I'm pretty sure we ignore this intentionally (at least that's what I always
> assumed), but let's ask Jon ...

I have no problems with that, but could you make some note to documentation or return error message for somebody who uses it on unsupported backend?
Comment 3 William Jon McCann 2013-06-06 13:48:13 UTC
Yes, ignoring the timeout hint is intentional in GNOME 3. Why would you want an error code returned? The application should not care about the details of how the notification policy manager behaves - and should not take steps to second guess it. What is it you are trying to do?
Comment 4 Matěj Cepl 2013-06-06 21:21:38 UTC
Nothing, just QA libnotify library. OK, so should I understand that gnome-shell just ignores parts of the API, and so gnome-shell is supposed to be non-conforming notification-daemon implementation forever and we shouldn’t check for it?
Comment 5 William Jon McCann 2013-06-06 23:17:45 UTC
Conforming to what? I'll be happy to change the spec to indicate this is a hint if that is what you are after.
Comment 6 Matěj Cepl 2013-06-07 12:12:02 UTC
I have problem with https://developer.gnome.org/libnotify/0.7/NotifyNotification.html#notify-notification-set-timeout ... one does uses this notify_notification_set_timeout method expecting changing the timeout and absolutely nothing happens. There is no error, warning, anything ... just it doesn't work. If I as a programmer could get a notice in libnotify documentation that this method is not supported with all backends (namely with gnome-shell), or that there would be some warning with the same message, or something. But the situation when it just doesn't work seems to me a bad experience.
Comment 8 Florian Müllner 2013-06-17 09:54:40 UTC
libnotify's documentation has been updated, so I don't see any reason to keep this bug open.