diff options
author | William Jon McCann <mccann@jhu.edu> | 2007-08-17 13:09:34 -0400 |
---|---|---|
committer | William Jon McCann <mccann@jhu.edu> | 2007-08-17 13:09:34 -0400 |
commit | 3e6bbcaea6d441956c9c1173d7586bd346a8c77b (patch) | |
tree | d2c35c5851dd5692659715dd8e8261bda388a593 | |
parent | 3d907714c526c4c685bb8c5dc13f91df22331cdb (diff) |
display the current vt
-rw-r--r-- | src/test-vt-monitor.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test-vt-monitor.c b/src/test-vt-monitor.c index e660645..c445865 100644 --- a/src/test-vt-monitor.c +++ b/src/test-vt-monitor.c @@ -37,6 +37,7 @@ #include <glib.h> #include "ck-vt-monitor.h" +#include "ck-sysdeps.h" static void activated_cb (CkVtMonitor *monitor, @@ -51,6 +52,9 @@ main (int argc, char **argv) { GMainLoop *loop; CkVtMonitor *monitor; + GError *error; + guint num; + gboolean res; if (! g_thread_supported ()) { g_thread_init (NULL); @@ -66,6 +70,14 @@ main (int argc, char **argv) monitor = ck_vt_monitor_new (); + res = ck_vt_monitor_get_active (monitor, &num, &error); + if (! res) { + g_warning ("Couldn't determine active VT: %s", error->message); + exit (1); + } + + g_message ("VT %u is currently active", num); + g_signal_connect (monitor, "active-changed", G_CALLBACK (activated_cb), |