From d1328d791c4f3b018df0695242c6c7e9fcde0881 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Wed, 18 Apr 2012 01:35:46 +0200 Subject: [PATCH] Switch to tty1 for console apps (Dingux build only). Console apps are always launched on tty1. However it can occur that the console displayed on the framebuffer is another one, so we have to explicitely activate tty1. --- src/linkapp.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/linkapp.cpp b/src/linkapp.cpp index 33777dd..f8da030 100644 --- a/src/linkapp.cpp +++ b/src/linkapp.cpp @@ -37,6 +37,10 @@ #include #include +#ifdef PLATFORM_DINGUX +#include +#endif + using fastdelegate::MakeDelegate; using namespace std; @@ -451,6 +455,15 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) { write(fd, &c, 1); close(fd); } + + fd = open("/dev/tty1", O_RDWR); + if (fd < 0) { + WARNING("Unable to open tty1 handle\n"); + } else { + if (ioctl(fd, VT_ACTIVATE, 1) < 0) + WARNING("Unable to activate tty1\n"); + close(fd); + } } #endif