Description of problem: When I converted a working Python class that made use of notification actions (add_action()) into a D-Bus service object, the actions stopped working. Version-Release number of selected component (if applicable): notify-python-0.1.0-3.fc6 dbus-1.0.1-12.fc6 How reproducible: 100% Steps to Reproduce: 1.python ./test-server.py 2.python ./test-client.py (in another window) 3.Click "Configure" in the notification Actual results: No output in the server terminal window. Expected results: configure clicked Additional info: Works fine if you take out the D-Bus bits and trigger the notification from a timeout.
Created attachment 155518 [details] test-server.py
Created attachment 155519 [details] test-client.py
Hmm, maybe pynotify.init() needs to be called before connecting to the bus. But why would that be?
No, that isn't it. Here is a revised test case. WORKS FINE on Fedora Core 6: libnotify-0.4.2-5.fc6 notify-python-0.1.0-3.fc6 FAILS on Fedora 7: libnotify-0.4.4-2.fc7 notify-python-0.1.0-4.fc7
Created attachment 156211 [details] test-client.py
Created attachment 156212 [details] test-server.py
In fact, here is a much simpler test case: ==> #!/usr/bin/python import pynotify import gobject class Note: def __init__ (self, loop): self.loop = loop def show (self): n = pynotify.Notification ('title', 'text') n.set_timeout (pynotify.EXPIRES_NEVER) n.add_action ("configure", "Configure", self.configure) n.show () def configure (self, *args): print args self.loop.quit () pynotify.init ("foo") loop = gobject.MainLoop () n = Note(loop) n.show () loop.run () <== How to reproduce: 1. Run the python code 2. Click the 'Configure' button Actual results: Program continues to run. Expected results: Program displays output and stops. Additional information: Works fine in FC6, fails in F7.
`notify-send foo` doesn't seem to even work in rawhide.
'notify-send foo' does work in rawhide now anyway, but the simple test case in comment #7 still fails to trigger the action (in rawhide). It does work in FC-6 and F-7. I installed the libnotify-debuginfo package and put a breakpoint on _action_signal_handler(). It was never called -- however, 'dbus-monitor --session' showed that the ActionInvoked signal was sent. dbus-1.0.2-4.fc7 dbus-glib-0.73-1.fc7 notification-daemon-0.3.7-4.fc8 libnotify-0.4.4-6.fc8 notify-python-0.1.0-4.fc7
Reassigned to libnotify owner.
Oddly enough, a very similar testcase works: #!/usr/bin/env python import gobject import pynotify def foo_cb(n, action): print "button clicked" n.close() if __name__ == '__main__': pynotify.init ("foo") loop = gobject.MainLoop () n = pynotify.Notification("title", "text") n.set_timeout (pynotify.EXPIRES_NEVER) n.add_action ("foo", "foo", foo_cb) n.show() loop.run ()
Argh! I see the problem now with the test case in comment #7 -- n (the pynotify.Notification object) goes out of scope as soon as Note.show() returns..! Sorry for the noise.