summaryrefslogtreecommitdiff
path: root/core/applets/vtapplet/vt.cpp
Side-by-side diff
Diffstat (limited to 'core/applets/vtapplet/vt.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/applets/vtapplet/vt.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/applets/vtapplet/vt.cpp b/core/applets/vtapplet/vt.cpp
index 0d4e657..7885f83 100644
--- a/core/applets/vtapplet/vt.cpp
+++ b/core/applets/vtapplet/vt.cpp
@@ -33,7 +33,7 @@ using namespace Opie::Core;
#include <linux/vt.h>
VTApplet::VTApplet ( )
- : QObject ( 0, "VTApplet" )
+ :QObject( 0, "VTApplet" ), m_ourVT( 0 )
{
}
@@ -96,6 +96,8 @@ QPopupMenu *VTApplet::popup ( QWidget* parent ) const
}
::close( fd );
+ m_ourVT = vtstat.v_active;
+
connect( m_subMenu, SIGNAL( activated(int) ), this, SLOT( changeVT(int) ) );
connect( m_subMenu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) );
@@ -114,6 +116,11 @@ void VTApplet::changeVT( int index )
#endif
if ( fd == -1 ) return;
ioctl( fd, VT_ACTIVATE, index-500 );
+ if ( m_ourVT )
+ {
+ odebug << "VTApplet::waiting for user to return to VT " << m_ourVT << oendl;
+ ioctl( fd, VT_WAITACTIVE, m_ourVT );
+ }
}