assert(property);
assert(s);
- if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "so", &sub))
+ if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "(so)", &sub))
return -ENOMEM;
LIST_FOREACH(sessions_by_seat, session, s->sessions) {
static int bus_seat_append_idle_hint(DBusMessageIter *i, const char *property, void *data) {
Seat *s = data;
- bool b;
+ dbus_bool_t b;
assert(i);
assert(property);
assert(s);
- b = seat_get_idle_hint(s, NULL);
+ b = seat_get_idle_hint(s, NULL) > 0;
if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
return -ENOMEM;
return r;
}
+
+int seat_send_changed(Seat *s, const char *properties) {
+ DBusMessage *m;
+ int r = -ENOMEM;
+ char *p = NULL;
+
+ assert(s);
+
+ if (!s->started)
+ return 0;
+
+ p = seat_bus_path(s);
+ if (!p)
+ return -ENOMEM;
+
+ m = bus_properties_changed_new(p, "org.freedesktop.login1.Seat", properties);
+ if (!m)
+ goto finish;
+
+ if (!dbus_connection_send(s->manager->bus, m, NULL))
+ goto finish;
+
+ r = 0;
+
+finish:
+ if (m)
+ dbus_message_unref(m);
+ free(p);
+
+ return r;
+}