Bug 241531 - Notification action is never called
Summary: Notification action is never called
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: system-config-printer
Version: rawhide
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 157324
TreeView+ depends on / blocked
 
Reported: 2007-05-27 12:03 UTC by Tim Waugh
Modified: 2007-11-30 22:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-07-05 11:53:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
test-server.py (855 bytes, text/x-python)
2007-05-27 12:03 UTC, Tim Waugh
no flags Details
test-client.py (286 bytes, text/x-python)
2007-05-27 12:04 UTC, Tim Waugh
no flags Details
test-client.py (667 bytes, text/x-python)
2007-06-05 12:36 UTC, Tim Waugh
no flags Details
test-server.py (612 bytes, text/x-python)
2007-06-05 12:37 UTC, Tim Waugh
no flags Details

Description Tim Waugh 2007-05-27 12:03:38 UTC
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.

Comment 1 Tim Waugh 2007-05-27 12:03:38 UTC
Created attachment 155518 [details]
test-server.py

Comment 2 Tim Waugh 2007-05-27 12:04:05 UTC
Created attachment 155519 [details]
test-client.py

Comment 3 Tim Waugh 2007-05-29 17:12:13 UTC
Hmm, maybe pynotify.init() needs to be called before connecting to the bus.  But
why would that be?

Comment 4 Tim Waugh 2007-06-05 12:35:28 UTC
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



Comment 5 Tim Waugh 2007-06-05 12:36:37 UTC
Created attachment 156211 [details]
test-client.py

Comment 6 Tim Waugh 2007-06-05 12:37:04 UTC
Created attachment 156212 [details]
test-server.py

Comment 7 Tim Waugh 2007-06-05 12:46:56 UTC
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.


Comment 8 Luke Macken 2007-06-06 22:56:17 UTC
`notify-send foo` doesn't seem to even work in rawhide.

Comment 9 Tim Waugh 2007-06-14 15:43:21 UTC
'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


Comment 10 Tim Waugh 2007-06-14 15:43:53 UTC
Reassigned to libnotify owner.

Comment 11 Matthias Clasen 2007-06-14 17:46:07 UTC
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 ()


Comment 12 Tim Waugh 2007-06-15 11:40:42 UTC
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.



Note You need to log in before you can comment on or make changes to this bug.