summaryrefslogtreecommitdiff
path: root/user/consolekit2/add-listseats.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/consolekit2/add-listseats.patch')
-rw-r--r--user/consolekit2/add-listseats.patch100
1 files changed, 100 insertions, 0 deletions
diff --git a/user/consolekit2/add-listseats.patch b/user/consolekit2/add-listseats.patch
new file mode 100644
index 000000000..44bc034c8
--- /dev/null
+++ b/user/consolekit2/add-listseats.patch
@@ -0,0 +1,100 @@
+diff --git a/data/ConsoleKit.conf b/data/ConsoleKit.conf
+index 6c10476..216a0e9 100644
+--- a/data/ConsoleKit.conf
++++ b/data/ConsoleKit.conf
+@@ -80,6 +80,9 @@
+ send_member="CloseSession"/>
+ <allow send_destination="org.freedesktop.ConsoleKit"
+ send_interface="org.freedesktop.ConsoleKit.Manager"
++ send_member="ListSeats"/>
++ <allow send_destination="org.freedesktop.ConsoleKit"
++ send_interface="org.freedesktop.ConsoleKit.Manager"
+ send_member="GetSeats"/>
+ <allow send_destination="org.freedesktop.ConsoleKit"
+ send_interface="org.freedesktop.ConsoleKit.Manager"
+diff --git a/src/ck-manager.c b/src/ck-manager.c
+index 4722bdb..7d8b8b2 100644
+--- a/src/ck-manager.c
++++ b/src/ck-manager.c
+@@ -3841,6 +3841,44 @@ dbus_unlock_session (ConsoleKitManager *ckmanager,
+ }
+
+ static gboolean
++dbus_list_seats (ConsoleKitManager *ckmanager,
++ GDBusMethodInvocation *context)
++{
++ CkManager *manager;
++ GVariantBuilder seat_builder;
++ GVariant *seat;
++ GHashTableIter seat_iter;
++ const gchar *key;
++ CkSeat *value;
++
++ TRACE ();
++
++ manager = CK_MANAGER (ckmanager);
++
++ g_return_val_if_fail (CK_IS_MANAGER (manager), FALSE);
++
++ /* if we don't have seats, we need to return NULL */
++ if (g_hash_table_size (manager->priv->seats) == 0) {
++ throw_error (context, CK_MANAGER_ERROR_NO_SEATS, _("User has no seats"));
++ return TRUE;
++ }
++
++ g_variant_builder_init (&seat_builder, G_VARIANT_TYPE_ARRAY);
++
++ g_hash_table_iter_init (&seat_iter, manager->priv->seats);
++ while (g_hash_table_iter_next (&seat_iter, &key, &value)) {
++ seat = g_variant_new("(so)",
++ console_kit_seat_get_name( CONSOLE_KIT_SEAT(value) ),
++ key);
++
++ g_variant_builder_add_value (&seat_builder, seat);
++ }
++
++ console_kit_manager_complete_list_seats (ckmanager, context, g_variant_builder_end (&seat_builder));
++ return TRUE;
++}
++
++static gboolean
+ dbus_get_seats (ConsoleKitManager *ckmanager,
+ GDBusMethodInvocation *context)
+ {
+@@ -4134,6 +4172,7 @@ ck_manager_iface_init (ConsoleKitManagerIface *iface)
+ iface->handle_stop = dbus_stop;
+ iface->handle_suspend = dbus_suspend;
+ iface->handle_close_session = dbus_close_session;
++ iface->handle_list_seats = dbus_list_seats;
+ iface->handle_get_seats = dbus_get_seats;
+ iface->handle_get_sessions = dbus_get_sessions;
+ iface->handle_get_sessions_for_unix_user = dbus_get_sessions_for_unix_user;
+diff --git a/src/org.freedesktop.ConsoleKit.Manager.xml b/src/org.freedesktop.ConsoleKit.Manager.xml
+index a44880c..024a3e2 100644
+--- a/src/org.freedesktop.ConsoleKit.Manager.xml
++++ b/src/org.freedesktop.ConsoleKit.Manager.xml
+@@ -531,6 +531,24 @@
+ </doc:doc>
+ </method>
+
++ <method name="ListSeats">
++ <arg name="seats" direction="out" type="a(so)">
++ <doc:doc>
++ <doc:summary>an array of seat names and IDs</doc:summary>
++ </doc:doc>
++ </arg>
++ <doc:doc>
++ <doc:description>
++ <doc:para>Retrieves a list of all <doc:ref type="interface" to="Seat">Seats</doc:ref>
++ that are present on the system.</doc:para>
++ <doc:para>Like the logind method of the same name, this returns both the seat's name
++ (such as "seat0") and the D-Bus object path for the seat object that implements the
++ <doc:ref type="interface" to="Seat">Seat</doc:ref> interface.</doc:para>
++ </doc:description>
++ <doc:seealso><doc:ref type="method" to="Manager.GetSeats">GetSeats()</doc:ref></doc:seealso>
++ </doc:doc>
++ </method>
++
+ <method name="GetSeats">
+ <arg name="seats" direction="out" type="ao">
+ <doc:doc>