1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-29 09:09:43 +02:00

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.
This commit is contained in:
Paul Cercueil 2012-04-18 01:35:46 +02:00
parent e6ca072c46
commit d1328d791c

View File

@ -37,6 +37,10 @@
#include <fstream>
#include <sstream>
#ifdef PLATFORM_DINGUX
#include <linux/vt.h>
#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