summaryrefslogtreecommitdiffstats
path: root/gui/gui.cpp
diff options
context:
space:
mode:
authorthat <github@that.at>2016-01-07 00:41:03 +0100
committerthat <github@that.at>2016-01-07 22:30:39 +0100
commit1964d19c464d25fb1898a8ea38579f97b36fafd5 (patch)
tree28873f60e59b701afd0eff38bd1d0407ccf39b7c /gui/gui.cpp
parentgui: add keyboard support for Ctrl layer and more special keys (diff)
downloadandroid_bootable_recovery-1964d19c464d25fb1898a8ea38579f97b36fafd5.tar
android_bootable_recovery-1964d19c464d25fb1898a8ea38579f97b36fafd5.tar.gz
android_bootable_recovery-1964d19c464d25fb1898a8ea38579f97b36fafd5.tar.bz2
android_bootable_recovery-1964d19c464d25fb1898a8ea38579f97b36fafd5.tar.lz
android_bootable_recovery-1964d19c464d25fb1898a8ea38579f97b36fafd5.tar.xz
android_bootable_recovery-1964d19c464d25fb1898a8ea38579f97b36fafd5.tar.zst
android_bootable_recovery-1964d19c464d25fb1898a8ea38579f97b36fafd5.zip
Diffstat (limited to 'gui/gui.cpp')
-rw-r--r--gui/gui.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/gui/gui.cpp b/gui/gui.cpp
index 63baeee92..08178fc17 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -80,6 +80,9 @@ static float scale_theme_h = 1;
// Needed by pages.cpp too
int gGuiRunning = 0;
+int g_pty_fd = -1; // set by terminal on init
+void terminal_pty_read();
+
static int gRecorder = -1;
extern "C" void gr_write_frame_to_file(int fd);
@@ -640,6 +643,17 @@ static int runPages(const char *page_name, const int stop_on_page_done)
for (;;)
{
loopTimer(input_timeout_ms);
+ if (g_pty_fd > 0) {
+ // TODO: this is not nice, we should have one central select for input, pty, and ors
+ FD_ZERO(&fdset);
+ FD_SET(g_pty_fd, &fdset);
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 1;
+ has_data = select(g_pty_fd+1, &fdset, NULL, NULL, &timeout);
+ if (has_data > 0) {
+ terminal_pty_read();
+ }
+ }
#ifndef TW_OEM_BUILD
if (ors_read_fd > 0 && !orsout) { // orsout is non-NULL if a command is still running
FD_ZERO(&fdset);