GNOME Bugzilla – Bug 701645
set_timeout method of Notification instance doesn’t have any effect
Last modified: 2013-06-17 09:54:40 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
I'm pretty sure we ignore this intentionally (at least that's what I always assumed), but let's ask Jon ...
(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?
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?
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?
Conforming to what? I'll be happy to change the spec to indicate this is a hint if that is what you are after.
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.
https://git.gnome.org/browse/libnotify/commit/?id=91280420269c98e408adc0db1e1d1e74cf24c71c
libnotify's documentation has been updated, so I don't see any reason to keep this bug open.