summaryrefslogtreecommitdiffstats
path: root/tdm/backend/ctrl.c
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2013-08-08 14:36:50 -0500
committerTimothy Pearson <[email protected]>2013-08-08 14:36:50 -0500
commit960cc8392da291eaf6c90d2101b721f6c20488f3 (patch)
tree63ecdf7a203cd721c0652bad2023a3e9f53f995c /tdm/backend/ctrl.c
parent3a84ecae5ded7370a7dfee43f25dd21269d65a7c (diff)
downloadtdebase-960cc8392da291eaf6c90d2101b721f6c20488f3.tar.gz
tdebase-960cc8392da291eaf6c90d2101b721f6c20488f3.zip
Update tdehw-based media manager for new mount API
Allow active VT to be queried from tdm Only display media notification messages on active VT Hide logout action buttons if logout process unstalls
Diffstat (limited to 'tdm/backend/ctrl.c')
-rw-r--r--tdm/backend/ctrl.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tdm/backend/ctrl.c b/tdm/backend/ctrl.c
index 622c9370d..4e10309e6 100644
--- a/tdm/backend/ctrl.c
+++ b/tdm/backend/ctrl.c
@@ -42,6 +42,9 @@ from the copyright holder.
#include <signal.h>
#include <pwd.h>
+#include <linux/vt.h>
+#include "getfd.h"
+
static void
acceptSock( CtrlRec *cr )
{
@@ -582,6 +585,21 @@ processCtrl( const char *string, int len, int fd, struct display *d )
ListSessions( flags, d, (void *)fd, emitXSessC, emitTTYSessC );
Reply( "\n" );
goto bust;
+ } else if (fd >= 0 && !strcmp( ar[0], "activevt" )) {
+#ifdef HAVE_VTS
+ Reply( "ok" );
+ int vt_fd = getfd(NULL);
+ if (vt_fd > 0) {
+ struct vt_stat vtstat;
+ if (!ioctl(vt_fd, VT_GETSTATE, &vtstat)) {
+ Writer( fd, cbuf, sprintf( cbuf, "\t%d", vtstat.v_active ) );
+ }
+ }
+ Reply( "\n" );
+#else
+ Reply( "notsup\tvirtual terminal support not available\n" );
+#endif
+ goto bust;
} else if (!strcmp( ar[0], "reserve" )) {
int lt = 60; /* XXX make default timeout configurable? */
if (ar[1]) {