-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/dbus signals #2
Conversation
I had the same problem too. Strangely, when closing the notification from the notification pane (in GNOME Shell) triggers only one signal, and closing it from the banner triggers 3 signals. Maybe a GNOME Shell issue.
Concerning the buffered channels length, it seems to be a known issue. See https://github.com/godbus/dbus/blob/master/_examples/signal.go#L19 and https://godoc.org/github.com/godbus/dbus#Conn.Signal |
Hmm, don't think it says anything about duplicate signals being delivered, just that signals will be dropped if the channel is not ready. So I'm thinking just adding a
|
Note that only one signal is received for (EDIT: added quotes to previous message for clarity) |
Ok. Edit: Actions are working correctly for me too in gnome shell 3.18 at least. |
Ok, I found something. It does indeed look like a gnome-shell bug: $ dbus-monitor "interface='org.freedesktop.Notifications'" When sending a notification and clicking it in gnome-shell, I see this in the monitor log:
You clearly see the NotificationClosed signal being sent 3 times by the same sender with a few nanosecond delay. Edit: I have reported this to gnome-shell bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=757084 |
Also, I am not sure if signal handling should be mandatory for using this library. |
Two solutions:
(The last one seems the best one) |
I think it will be ok to keep it as is. The users that only want to send notifications, can use the simple 'static' call: |
This seems to work for me.
I have to add a buffered chan with close to length 5, because otherwise something hangs. This must be resolved before a merge.
I think it is related to this:
Every signal gets delivered at least 3-4 times in a row. I'm not sure of why this happens.