[input] Disconnect the logind connection once setupLibInput is called
Don't want it to be called again if we lose session control.
This commit is contained in:
parent
26c44a6524
commit
7a96c3ee46
2 changed files with 7 additions and 1 deletions
|
@ -206,7 +206,7 @@ InputRedirection::InputRedirection(QObject *parent)
|
|||
setupLibInput();
|
||||
} else {
|
||||
logind->takeControl();
|
||||
connect(logind, &LogindIntegration::hasSessionControlChanged, this, &InputRedirection::setupLibInput);
|
||||
m_sessionControlConnection = connect(logind, &LogindIntegration::hasSessionControlChanged, this, &InputRedirection::setupLibInput);
|
||||
}
|
||||
};
|
||||
if (logind->isConnected()) {
|
||||
|
@ -240,6 +240,10 @@ void InputRedirection::setupLibInput()
|
|||
if (!Application::usesLibinput()) {
|
||||
return;
|
||||
}
|
||||
if (m_sessionControlConnection) {
|
||||
disconnect(m_sessionControlConnection);
|
||||
m_sessionControlConnection = QMetaObject::Connection();
|
||||
}
|
||||
LibInput::Connection *conn = LibInput::Connection::create(this);
|
||||
if (conn) {
|
||||
conn->setup();
|
||||
|
|
2
input.h
2
input.h
|
@ -197,6 +197,8 @@ private:
|
|||
|
||||
GlobalShortcutsManager *m_shortcuts;
|
||||
|
||||
QMetaObject::Connection m_sessionControlConnection;
|
||||
|
||||
KWIN_SINGLETON(InputRedirection)
|
||||
friend InputRedirection *input();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue