diff --git a/.circleci/config.yml b/.circleci/config.yml index 20a8d634f..11bb9bea4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,6 +56,7 @@ jobs: - QT_TARGET: rpi4-static steps: - checkout + - run: git apply ./etc/rpi4/kms_launch_fix.diff - run: .circleci/prepare.sh - run: .circleci/build.sh - run: arm-linux-gnueabihf-objdump -p installdir/opt/pegasus-frontend/pegasus-fe | grep 'NEEDED' | sort diff --git a/etc/rpi4/kms_launch_fix.diff b/etc/rpi4/kms_launch_fix.diff new file mode 100644 index 000000000..dfbf988d9 --- /dev/null +++ b/etc/rpi4/kms_launch_fix.diff @@ -0,0 +1,86 @@ +diff --git a/src/backend/ProcessLauncher.cpp b/src/backend/ProcessLauncher.cpp +index d39cce9..b994aeb 100644 +--- a/src/backend/ProcessLauncher.cpp ++++ b/src/backend/ProcessLauncher.cpp +@@ -28,6 +28,14 @@ + #include + #include + ++#define private public ++#include ++#include ++#undef private ++#include ++#include ++#include ++ + + namespace { + static constexpr auto SEPARATOR = "----------------------------------------"; +@@ -165,7 +173,6 @@ void ProcessLauncher::runProcess(const QString& command, const QStringList& args + m_process = new QProcess(this); + + // set up signals and slots +- connect(m_process, &QProcess::started, this, &ProcessLauncher::onProcessStarted); + connect(m_process, &QProcess::errorOccurred, this, &ProcessLauncher::onProcessError); + connect(m_process, static_cast(&QProcess::finished), + this, &ProcessLauncher::onProcessFinished); +@@ -174,15 +181,28 @@ void ProcessLauncher::runProcess(const QString& command, const QStringList& args + m_process->setProcessChannelMode(QProcess::ForwardedChannels); + m_process->setInputChannelMode(QProcess::ForwardedInputChannel); + m_process->setWorkingDirectory(workdir); +- m_process->start(command, args, QProcess::ReadOnly); +- m_process->waitForStarted(-1); ++ m_process->setProgram(command); ++ m_process->setArguments(args); ++ onProcessStarted(); + } + + void ProcessLauncher::onTeardownComplete() + { + Q_ASSERT(m_process); + ++ auto platint = static_cast(QGuiApplicationPrivate::platformIntegration()); ++ ++ platint->destroy(); ++ platint->m_vtHandler.reset(nullptr); ++ ++ m_process->start(QProcess::ReadOnly); + m_process->waitForFinished(-1); ++ ++ const bool backup = platint->m_disableInputHandlers; ++ platint->m_disableInputHandlers = true; ++ platint->initialize(); ++ platint->m_disableInputHandlers = backup; ++ + emit processFinished(); + } + +@@ -236,7 +256,6 @@ void ProcessLauncher::onProcessFinished(int exitcode, QProcess::ExitStatus exits + + void ProcessLauncher::beforeRun() + { +- TerminalKbd::enable(); + ScriptRunner::run(ScriptEvent::PROCESS_STARTED); + } + +@@ -247,5 +266,4 @@ void ProcessLauncher::afterRun() + m_process = nullptr; + + ScriptRunner::run(ScriptEvent::PROCESS_FINISHED); +- TerminalKbd::disable(); + } +diff --git a/src/backend/backend.pro b/src/backend/backend.pro +index fe116bd..e5d61a9 100644 +--- a/src/backend/backend.pro ++++ b/src/backend/backend.pro +@@ -8,6 +8,9 @@ android: QT += androidextras + else: QT += gamepad + + ++QT += gui-private eglfsdeviceintegration-private ++ ++ + SOURCES += \ + Api.cpp \ + AppContext.cpp \