From 7358410ead8c3d278fc2a93fca5c6a0f02c5cc33 Mon Sep 17 00:00:00 2001
From: tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>
Date: Fri, 23 Sep 2011 05:20:41 +0000
Subject: Automatically switch to activating terminal on login with
 smartcardauth

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/smartcardauth@1255034 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
---
 src/smartauthmon.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/smartauthmon.cpp b/src/smartauthmon.cpp
index 88bccee..f2b93df 100644
--- a/src/smartauthmon.cpp
+++ b/src/smartauthmon.cpp
@@ -674,7 +674,7 @@ int main (int argc, char *argv[])
 							if (newdisplayint == (MAXIMUM_VTS+1)) {
 								writeerror = true;
 								systemexec(TRINITY_BIN_PREFIX "kdmctl -g reserve");
-								usleep(1000000);
+								usleep(3000000);
 							}
 							if (writeerror)
 								have_valid_display = false;
@@ -685,6 +685,7 @@ int main (int argc, char *argv[])
 						{
 							// Could not find any existing kdm sessions; start a new one
 							systemexec(TRINITY_BIN_PREFIX "kdmctl -g reserve");
+							usleep(3000000);
 						}
 					}
 
@@ -698,6 +699,7 @@ int main (int argc, char *argv[])
 						printf("Unable to write to KDM control socket %s\n\r", (TQString(KDM_CONTROL_FIFO_FILE).tqarg(newdisplayint)).ascii()); fflush(stdout);
 					}
 
+					systemexec((TQString(TRINITY_BIN_PREFIX "kdmctl -g activate %1").tqarg(newdisplay)).ascii());
 					udisplay=newdisplay;
 				}
 
-- 
cgit v1.2.3

