diff --git a/logind.cpp b/logind.cpp index 0a2c356ac0..22a86cdfce 100644 --- a/logind.cpp +++ b/logind.cpp @@ -237,6 +237,9 @@ void LogindIntegration::takeControl() qCDebug(KWIN_CORE) << "Gained session control"; m_sessionControl = true; emit hasSessionControlChanged(true); + m_bus.connect(s_login1Service, m_sessionPath, + s_login1SessionInterface, QStringLiteral("PauseDevice"), + this, SLOT(pauseDevice(uint,uint,QString))); } ); } @@ -292,4 +295,14 @@ void LogindIntegration::releaseDevice(int fd) m_bus.asyncCall(message); } +void LogindIntegration::pauseDevice(uint devMajor, uint devMinor, const QString &type) +{ + if (QString::compare(type, QStringLiteral("pause"), Qt::CaseInsensitive) == 0) { + // unconditionally call complete + QDBusMessage message = QDBusMessage::createMethodCall(s_login1Service, m_sessionPath, s_login1SessionInterface, QStringLiteral("PauseDeviceComplete")); + message.setArguments(QVariantList({QVariant(devMajor), QVariant(devMinor)})); + m_bus.asyncCall(message); + } +} + } // namespace diff --git a/logind.h b/logind.h index 7165990938..9a3f4563a8 100644 --- a/logind.h +++ b/logind.h @@ -64,6 +64,7 @@ Q_SIGNALS: private Q_SLOTS: void getSessionActive(); void getVirtualTerminal(); + void pauseDevice(uint major, uint minor, const QString &type); private: friend class LogindTest;