X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogind-seat-dbus.c;h=4937d65f745adc60f78c6e30baf7f9e248b1d12c;hp=63b1bd5ed8e410035873bd5d6bf11e2911e64cf8;hb=f401e48c2db22ff9d1a05885b5599bebf19c2707;hpb=34ca941cec76bbfdfd02c705b76bc1b53ea2bcd1 diff --git a/src/logind-seat-dbus.c b/src/logind-seat-dbus.c index 63b1bd5ed..4937d65f7 100644 --- a/src/logind-seat-dbus.c +++ b/src/logind-seat-dbus.c @@ -29,8 +29,12 @@ #define BUS_SEAT_INTERFACE \ " \n" \ " \n" \ + " \n" \ + " \n" \ + " \n" \ " \n" \ - " \n" \ + " \n" \ + " \n" \ " \n" \ " \n" \ @@ -125,6 +129,23 @@ static int bus_seat_append_sessions(DBusMessageIter *i, const char *property, vo return 0; } + +static int bus_seat_append_can_activate(DBusMessageIter *i, const char *property, void *data) { + Seat *s = data; + dbus_bool_t b; + + assert(i); + assert(property); + assert(s); + + b = s->manager->vtconsole == s; + + if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b)) + return -ENOMEM; + + return 0; +} + static int get_seat_for_path(Manager *m, const char *path, Seat **_s) { Seat *s; char *id; @@ -156,9 +177,10 @@ static DBusHandlerResult seat_message_dispatch( DBusMessage *message) { const BusProperty properties[] = { - { "org.freedesktop.login1.Seat", "Id", bus_property_append_string, "s", s->id }, - { "org.freedesktop.login1.Seat", "Active", bus_seat_append_active, "(so)", s }, - { "org.freedesktop.login1.Seat", "Sessions", bus_seat_append_sessions, "a(so)", s }, + { "org.freedesktop.login1.Seat", "Id", bus_property_append_string, "s", s->id }, + { "org.freedesktop.login1.Seat", "ActiveSession", bus_seat_append_active, "(so)", s }, + { "org.freedesktop.login1.Seat", "CanActivateSessions", bus_seat_append_can_activate, "b", s }, + { "org.freedesktop.login1.Seat", "Sessions", bus_seat_append_sessions, "a(so)", s }, { NULL, NULL, NULL, NULL, NULL } };