Re: [Muine] QuitEvent for plugins and dbus (PATCH)



> Well, I really think it's quite useful. The way I see it now is that
> you create an external dbus aware program and hook into song and state
> change signals. But if the user closes muine then the external dbus
> app doesn't gets notified and it  waits forever for a song (or state)
> change event...

You could watch for a org.freedesktop.DBus.ServiceOwnerChanged signal.
When muine starts, we get:

signal interface=org.freedesktop.DBus; member=ServiceOwnerChanged;
sender=org.freedesktop.DBus
string:org.gnome.Muine
string:
string::NUM.NUM

And when muine quits, we get:

signal interface=org.freedesktop.DBus; member=ServiceOwnerChanged;
sender=org.freedesktop.DBus
string:org.gnome.Muine
string::NUM.NUM
string:

This is internal and will fire all the time, regardless of whether
muine is killed or shut down correctly. If muine is killed and a
program is waiting for a quit signal, it will wait indefinitely. With
this method, we know for sure that we're done and can move on.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]