Fix compat for older versions of GObject

Older versions of GObject had the "user data" parameter of most signal
handlers marked as required, some value had to be passed in, even if it
wasn't necessary.
This commit is contained in:
Dustin C. Hatch
2014-08-06 16:02:38 -05:00
parent feadbbdcbb
commit 40e7f99aa3

View File

@@ -166,7 +166,7 @@ class Notifier(object):
'XF86AudioPrev': self.client.previous,
'XF86AudioStop': self.client.stop,
}
def callback(keystring):
def callback(keystring, data=None):
self.client.noidle()
try:
handlers[keystring]()
@@ -175,7 +175,7 @@ class Notifier(object):
self.client.send_idle('player')
Keybinder.init()
for key in handlers.keys():
Keybinder.bind(key, callback)
Keybinder.bind(key, callback, None)
def connect(self):
self.client._sock = None
@@ -305,12 +305,12 @@ def main():
notifier.bind_keys()
notifier.start()
def quit():
def quit(data=None):
notifier.stop()
Gtk.main_quit()
raise SystemExit
for s in (signal.SIGINT, signal.SIGTERM):
GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, s, quit)
GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, s, quit, None)
Gtk.main()