mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-25 18:48:27 +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:
parent
e6ca072c46
commit
d1328d791c
@ -37,6 +37,10 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#ifdef PLATFORM_DINGUX
|
||||||
|
#include <linux/vt.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using fastdelegate::MakeDelegate;
|
using fastdelegate::MakeDelegate;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -451,6 +455,15 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
|
|||||||
write(fd, &c, 1);
|
write(fd, &c, 1);
|
||||||
close(fd);
|
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
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user