From 4fed37113499fe999bf0c0f171e57215305aba27 Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Sat, 20 May 2017 05:23:02 +0300 Subject: feat: Add dbus method GetVTNr to Session This method call simple returns the VTNr property but may be useful to applications that don't want to connect to all the dbus properies to query just that one. --- src/ck-session.c | 11 +++++++++++ src/org.freedesktop.ConsoleKit.Session.xml | 14 ++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'src') diff --git a/src/ck-session.c b/src/ck-session.c index f8913cd..64c3847 100644 --- a/src/ck-session.c +++ b/src/ck-session.c @@ -1279,6 +1279,16 @@ dbus_get_login_session_id (ConsoleKitSession *cksession, return TRUE; } +static gboolean +dbus_get_vtnr (ConsoleKitSession *cksession, + GDBusMethodInvocation *context) +{ + TRACE (); + + console_kit_session_complete_get_vtnr (cksession, context, console_kit_session_get_vtnr (cksession)); + return TRUE; +} + gboolean ck_session_set_login_session_id (CkSession *session, const char *login_session_id, @@ -1978,6 +1988,7 @@ ck_session_iface_init (ConsoleKitSessionIface *iface) iface->handle_get_unix_user = dbus_get_unix_user; iface->handle_get_seat_id = dbus_get_seat_id; iface->handle_get_login_session_id = dbus_get_login_session_id; + iface->handle_get_vtnr = dbus_get_vtnr; iface->handle_get_session_type = dbus_get_session_type; iface->handle_get_x11_display_device = dbus_get_x11_display_device; iface->handle_get_display_device = dbus_get_display_device; diff --git a/src/org.freedesktop.ConsoleKit.Session.xml b/src/org.freedesktop.ConsoleKit.Session.xml index 6fb8129..a94e771 100644 --- a/src/org.freedesktop.ConsoleKit.Session.xml +++ b/src/org.freedesktop.ConsoleKit.Session.xml @@ -162,6 +162,20 @@ + + + + The virtual terminal the session runs on, if any, 0 otherwise + + + + Returns the value of the virtual terminal that the + underlying session runs on. If the seat doesn't support VTs, then this will always + return 0. + Since 1.1.2 + + + -- cgit v1.2.3