linuxmint/cjs

gi.Notify fails (timeout)

Closed this issue · 6 comments

Try this in Looking Glass:
Warning: You must wait some time, if you can reproduce this. Maybe you should use a virtual machine.

>>> Notify = imports.gi.Notify
 [object GIRepesitoryNamespace]
>>> Notify.init("looking-glass") //the string can be any else
 true
>>> n = Notify.Notification({summary: "foo", body: "bar", "icon-name": "dialog-information"})
 [<some other object>]
>>> n.show()
 - after some time (~25s) -
 <exception Gio.IOErrorEnum: timeout>
 <execution time> is something like 25000

The screen will freeze for this period.

Why does the timeout occur? Is there another Notification API for this in cjs?

Is this on stable or git?

We did recently add support for notification timeouts: linuxmint/cinnamon@e6ce8b4

But as far as I understand, notifications have no expiration by default, and I'm not sure why it would throw an error like that.

This error occurs in the stables of 2.1 and 2.2.
The problem is, that n.show() takes ~ 25 seconds; all is freezing.

The commit you showed me is on another JS module, should I use that?

Sorry, I thought you meant the notification disappears after some time.

I'll try this here

I got the code from this website: https://wiki.archlinux.org/index.php/Notify_OSD#Standalone.
Due the lack of documentation, I only tried this. I saw the .ui.notificationDaemon module, but I could not get it to work.

I get the same behavior in 2.3. I'm not sure what might be to blame though, we don't use libnotify in Cinnamon itself (we do use it in the settings app though). Instead we use our own baked-in method.

Not certain what you're using this for, but if you want to send just simple notifications to the user, you can use Main.notify and friends (see: https://github.com/linuxmint/Cinnamon/blob/master/js/ui/main.js#L839), or construct your own, more customized notification.

Thanks, this is exactly what could replace it!
(Maybe you could disable the .gi.Notify Module, and refer to these other functions)