[wayland] Destroy input method connection after process finished
More cleanup.
This commit is contained in:
parent
0bf51d99f6
commit
fa6fbbdfc1
3 changed files with 23 additions and 1 deletions
|
@ -188,6 +188,15 @@ void ApplicationWayland::continueStartupWithX()
|
|||
environment.remove("DISPLAY");
|
||||
environment.remove("WAYLAND_DISPLAY");
|
||||
QProcess *p = new QProcess(this);
|
||||
auto finishedSignal = static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished);
|
||||
connect(p, finishedSignal, this,
|
||||
[this, p] {
|
||||
if (waylandServer()) {
|
||||
waylandServer()->destroyInputMethodConnection();
|
||||
}
|
||||
p->deleteLater();
|
||||
}
|
||||
);
|
||||
p->setProcessEnvironment(environment);
|
||||
p->start(m_inputMethodServerToStart);
|
||||
p->waitForStarted();
|
||||
|
|
|
@ -71,7 +71,10 @@ WaylandServer::WaylandServer(QObject *parent)
|
|||
qRegisterMetaType<KWayland::Server::OutputInterface::DpmsMode>();
|
||||
}
|
||||
|
||||
WaylandServer::~WaylandServer() = default;
|
||||
WaylandServer::~WaylandServer()
|
||||
{
|
||||
destroyInputMethodConnection();
|
||||
}
|
||||
|
||||
void WaylandServer::destroyInternalConnection()
|
||||
{
|
||||
|
@ -292,6 +295,15 @@ int WaylandServer::createInputMethodConnection()
|
|||
return sx[1];
|
||||
}
|
||||
|
||||
void WaylandServer::destroyInputMethodConnection()
|
||||
{
|
||||
if (!m_inputMethodServerConnection) {
|
||||
return;
|
||||
}
|
||||
m_inputMethodServerConnection->destroy();
|
||||
m_inputMethodServerConnection = nullptr;
|
||||
}
|
||||
|
||||
void WaylandServer::createInternalConnection()
|
||||
{
|
||||
int sx[2];
|
||||
|
|
|
@ -115,6 +115,7 @@ public:
|
|||
* @returns file descriptor to the input method server's socket.
|
||||
**/
|
||||
int createInputMethodConnection();
|
||||
void destroyInputMethodConnection();
|
||||
|
||||
void createInternalConnection();
|
||||
void destroyInternalConnection();
|
||||
|
|
Loading…
Reference in a new issue