summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-10-02 17:10:53 -0300
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-10-02 17:10:53 -0300
commitd6a4551d32bff4624e4a7f72aac25fea051f3c14 (patch)
tree112650e443d996738813163404f58bdd5653e637 /input
parente34d450d1fbcdcc5b1fa688c80edcfdf1fafb18d (diff)
Add code to emit PropertyChanged on input interface.
Diffstat (limited to 'input')
-rw-r--r--input/device.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/input/device.c b/input/device.c
index adcb42ae..90b4b9ad 100644
--- a/input/device.c
+++ b/input/device.c
@@ -401,6 +401,7 @@ static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond, gpointer data
{
struct input_conn *iconn = data;
struct input_device *idev = iconn->idev;
+ gboolean connected = FALSE;
if (cond & (G_IO_HUP | G_IO_ERR))
g_io_channel_close(chan);
@@ -408,6 +409,9 @@ static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond, gpointer data
g_dbus_emit_signal(idev->conn, idev->path,
INPUT_DEVICE_INTERFACE, "Disconnected",
DBUS_TYPE_INVALID);
+ dbus_connection_emit_property_changed(idev->conn, idev->path,
+ INPUT_DEVICE_INTERFACE, "Connected",
+ DBUS_TYPE_BOOLEAN, &connected);
g_source_remove(iconn->ctrl_watch);
iconn->ctrl_watch = 0;
@@ -1225,6 +1229,7 @@ int input_device_connadd(const bdaddr_t *src, const bdaddr_t *dst)
struct input_device *idev;
struct input_conn *iconn;
int err;
+ gboolean connected;
idev = find_device(src, dst);
if (!idev)
@@ -1240,9 +1245,14 @@ int input_device_connadd(const bdaddr_t *src, const bdaddr_t *dst)
iconn->intr_watch = create_watch(iconn->intr_sk, intr_watch_cb, iconn);
iconn->ctrl_watch = create_watch(iconn->ctrl_sk, ctrl_watch_cb, iconn);
+ connected = TRUE;
g_dbus_emit_signal(idev->conn, idev->path,
INPUT_DEVICE_INTERFACE, "Connected",
DBUS_TYPE_INVALID);
+ dbus_connection_emit_property_changed(idev->conn, idev->path,
+ INPUT_DEVICE_INTERFACE, "Connected",
+ DBUS_TYPE_BOOLEAN, &connected);
+
return 0;
error: