From bfcb1628b714e9e94cf39312c4255aa95d1be1f9 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 21 Nov 2012 22:05:15 +0100 Subject: [PATCH] dbus: Fix event handling The port to glib failed to actually watch the file descriptor for events and thus awesome silently ignored all dbus messages. My bad. Signed-off-by: Uli Schlachter --- dbus.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dbus.c b/dbus.c index b5432bf13..99d37a498 100644 --- a/dbus.c +++ b/dbus.c @@ -494,7 +494,7 @@ a_dbus_process_requests_on_bus(DBusConnection *dbus_connection, GSource **source * \param revents (not used) */ static gboolean -a_dbus_process_requests_session(GIOChannel *source, GIOCondition cond, gpointer data) +a_dbus_process_requests_session(gpointer data) { a_dbus_process_requests_on_bus(dbus_connection_session, &session_source); return TRUE; @@ -505,7 +505,7 @@ a_dbus_process_requests_session(GIOChannel *source, GIOCondition cond, gpointer * \param revents (not used) */ static gboolean -a_dbus_process_requests_system(GIOChannel *source, GIOCondition cond, gpointer data) +a_dbus_process_requests_system(gpointer data) { a_dbus_process_requests_on_bus(dbus_connection_system, &system_source); return TRUE; @@ -592,7 +592,7 @@ a_dbus_release_name(DBusConnection *dbus_connection, const char *name) * \return The requested D-Bus connection on success, NULL on failure. */ static DBusConnection * -a_dbus_connect(DBusBusType type, const char *type_name, GIOFunc cb, GSource **source) +a_dbus_connect(DBusBusType type, const char *type_name, GSourceFunc cb, GSource **source) { int fd; DBusConnection *dbus_connection; @@ -615,6 +615,8 @@ a_dbus_connect(DBusBusType type, const char *type_name, GIOFunc cb, GSource **so GIOChannel *channel = g_io_channel_unix_new(fd); *source = g_io_create_watch(channel, G_IO_IN); g_io_channel_unref(channel); + g_source_set_callback(*source, cb, NULL, NULL); + g_source_attach(*source, NULL); fcntl(fd, F_SETFD, FD_CLOEXEC); }