diff options
author | Eric Koegel <eric.koegel@gmail.com> | 2017-05-20 05:23:02 +0300 |
---|---|---|
committer | Eric Koegel <eric.koegel@gmail.com> | 2017-05-20 05:24:13 +0300 |
commit | 4fed37113499fe999bf0c0f171e57215305aba27 (patch) | |
tree | b7d898a17c8088c5c092d0bfa0d2795a6863d9cc /src | |
parent | 2314496430b09a6234b37bdab79a3c5ef0866f99 (diff) | |
download | ConsoleKit2-4fed37113499fe999bf0c0f171e57215305aba27.tar.gz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/ck-session.c | 11 | ||||
-rw-r--r-- | src/org.freedesktop.ConsoleKit.Session.xml | 14 |
2 files changed, 25 insertions, 0 deletions
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 @@ </doc:description> </doc:doc> </method> + <method name="GetVTNr"> + <arg name="VTNr" direction="out" type="u"> + <doc:doc> + <doc:summary>The virtual terminal the session runs on, if any, 0 otherwise</doc:summary> + </doc:doc> + </arg> + <doc:doc> + <doc:description><doc:para>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.</doc:para> + <doc:para>Since 1.1.2</doc:para> + </doc:description> + </doc:doc> + </method> <method name="IsActive"> <arg name="active" direction="out" type="b"> <doc:doc> |