-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <QDir> | ||
#include <QRegularExpression> | ||
|
||
+#define private public | ||
+#include <QGuiApplication> | ||
+#include <private/qeglfsintegration_p.h> | ||
+#undef private | ||
+#include <private/qfbvthandler_p.h> | ||
+#include <private/qguiapplication_p.h> | ||
+#include <qpa/qplatformintegration.h> | ||
+ | ||
|
||
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<void(QProcess::*)(int, QProcess::ExitStatus)>(&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<QEglFSIntegration* const>(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 \ |