From 960cc8392da291eaf6c90d2101b721f6c20488f3 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 8 Aug 2013 14:36:50 -0500 Subject: 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 --- tdmlib/dmctl.cpp | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'tdmlib/dmctl.cpp') diff --git a/tdmlib/dmctl.cpp b/tdmlib/dmctl.cpp index 9cf7e9d34..c4fc0a5dd 100644 --- a/tdmlib/dmctl.cpp +++ b/tdmlib/dmctl.cpp @@ -392,8 +392,42 @@ DM::switchVT( int vt ) void DM::lockSwitchVT( int vt ) { - if (switchVT( vt )) - kapp->dcopClient()->send( "kdesktop", "KScreensaverIface", "lock()", TQString("") ); + if (switchVT( vt )) { + TQByteArray data; + TQCString replyType; + TQByteArray replyData; + // Block here until lock is complete + // If this is not done the desktop of the locked session will be shown after VT switch until the lock fully engages! + kapp->dcopClient()->call("kdesktop", "KScreensaverIface", "lock()", data, replyType, replyData); + } +} + +int +DM::activeVT() +{ + if (DMType == OldTDM) { + return -1; + } + + TQCString re; + + if (DMType == GDM) { + return -1; + } + else { + if (!exec( "activevt\n", re )) { + return -1; + } + TQString retrunc = TQString( re.data() + 3 ); + bool ok = false; + int activevt = retrunc.toInt(&ok, 10); + if (ok) { + return activevt; + } + else { + return -1; + } + } } void -- cgit v1.2.3