Branch: master

48cf3058 2015-10-01 03:29:59 Timothy Pearson
Move VT switch on card insertion to cryptocardwatcher process
M kdesktop/lock/lockprocess.cc
M tdm/cryptocardwatcher/watcher.cc
diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc
index 38526d6..5cf4225 100644
--- a/kdesktop/lock/lockprocess.cc
+++ b/kdesktop/lock/lockprocess.cc
@@ -2831,21 +2831,6 @@
 	if (login_name != "") {
 		KUser user;
 		if (login_name == user.loginName()) {
-			// Activate appropriate VT
-			DM dm;
-			SessList sess;
-			if (dm.localSessions(sess)) {
-				TQString user, loc;
-				for (SessList::ConstIterator it = sess.begin(); it != sess.end(); ++it) {
-					DM::sess2Str2(*it, user, loc);
-					if ((*it).self) {
-						// Switch VTs
-						DM().switchVT((*it).vt);
-						break;
-					}
-				}
-			}
-
 			// Pass login to the PAM stack...
 			m_loginCardDevice = cdevice;
 			if (dynamic_cast<SAKDlg*>(currentDialog)) {
diff --git a/tdm/cryptocardwatcher/watcher.cc b/tdm/cryptocardwatcher/watcher.cc
index 021f599..ecd4e8f 100644
--- a/tdm/cryptocardwatcher/watcher.cc
+++ b/tdm/cryptocardwatcher/watcher.cc
@@ -66,6 +66,10 @@
 				if (user.startsWith(login_name + ": ")) {
 					// Found active session
 					user_active = true;
+
+					// Switch VTs
+					DM().switchVT((*it).vt);
+
 					break;
 				}
 				if (user == "Unused") {