diff options
| author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-11-07 18:58:45 -0300 | 
|---|---|---|
| committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-11-07 18:58:45 -0300 | 
| commit | a218e9ef197edef59b1a96b50e3656993c28ffda (patch) | |
| tree | c03d7b78f1c58acf2ee38fc5d730079452860bfb | |
| parent | f449b80bffc98b01f4460905985a97416e5da8e2 (diff) | |
Fix Connected property on input interface always being inverted.
is_connected where being used as the compare function on
g_slist_find_custom which doesn't work as expected.
| -rw-r--r-- | input/device.c | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/input/device.c b/input/device.c index af118bfa..6564b90d 100644 --- a/input/device.c +++ b/input/device.c @@ -985,6 +985,13 @@ static void device_unregister(void *data)  	input_device_free(idev);  } +static gint connected_cmp(gpointer a, gpointer b) +{ +	struct input_conn *iconn = a; + +	return !is_connected(iconn); +} +  static DBusMessage *device_get_properties(DBusConnection *conn,  					DBusMessage *msg, void *data)  { @@ -1007,7 +1014,7 @@ static DBusMessage *device_get_properties(DBusConnection *conn,  	/* Connected */  	connected = !!g_slist_find_custom(idev->connections, NULL, -					(GCompareFunc) is_connected); +					(GCompareFunc) connected_cmp);  	dict_append_entry(&dict, "Connected", DBUS_TYPE_BOOLEAN, &connected);  	dbus_message_iter_close_container(&iter, &dict); | 
