summaryrefslogtreecommitdiff
path: root/core/applets/vtapplet/vt.cpp
Side-by-side diff
Diffstat (limited to 'core/applets/vtapplet/vt.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/vtapplet/vt.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/applets/vtapplet/vt.cpp b/core/applets/vtapplet/vt.cpp
index aec63c3..7832ee0 100644
--- a/core/applets/vtapplet/vt.cpp
+++ b/core/applets/vtapplet/vt.cpp
@@ -80,7 +80,11 @@ QPopupMenu *VTApplet::popup ( QWidget* parent ) const
odebug << "VTApplet::popup" << oendl;
struct vt_stat vtstat;
+#ifdef QT_QWS_DEVFS
+ int fd = ::open( "/dev/vc/0", O_RDWR );
+#else
int fd = ::open( "/dev/tty0", O_RDWR );
+#endif
if ( fd == -1 ) return 0;
if ( ioctl( fd, VT_GETSTATE, &vtstat ) == -1 ) return 0;
@@ -104,7 +108,11 @@ void VTApplet::changeVT( int index )
{
//odebug << "VTApplet::changeVT( " << index-500 << " )" << oendl;
+#ifdef QT_QWS_DEVFS
+ int fd = ::open("/dev/vc/0", O_RDWR);
+#else
int fd = ::open("/dev/tty0", O_RDWR);
+#endif
if ( fd == -1 ) return;
ioctl( fd, VT_ACTIVATE, index-500 );
}