From 6caed0053e1c938737111e9f34c671803131bfbf Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 22 Mar 2007 14:53:22 +0000 Subject: input: Added the Disconnect signal --- input/device.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'input/device.c') diff --git a/input/device.c b/input/device.c index fe38e759..5ebeb1ec 100644 --- a/input/device.c +++ b/input/device.c @@ -853,12 +853,21 @@ static DBusHandlerResult device_disconnect(DBusConnection *conn, DBusMessage *msg, void *data) { struct device *idev = data; + DBusMessage *signal; + const char *path; if (disconnect(idev, 0) < 0) return err_failed(conn, msg, strerror(errno)); - return send_message_and_unref(conn, + /* Replying to the requestor */ + send_message_and_unref(conn, dbus_message_new_method_return(msg)); + + /* Sending the Disconnect signal */ + path = dbus_message_get_path(msg); + signal = dbus_message_new_signal(path, + INPUT_DEVICE_INTERFACE, "Disconnected"); + return send_message_and_unref(conn, signal); } static DBusHandlerResult device_is_connected(DBusConnection *conn, -- cgit