diff --git a/src/screenlockdetector.cpp b/src/screenlockdetector.cpp index 35cc66b..7fc4473 100644 --- a/src/screenlockdetector.cpp +++ b/src/screenlockdetector.cpp @@ -204,7 +204,7 @@ bool ScreenLockDetector::connectToUkuiManager() "org.ukui.ScreenSaver", sessionPath, "org.ukui.ScreenSaver", - QDBusConnection::systemBus(), + QDBusConnection::sessionBus(), this ); @@ -212,7 +212,7 @@ bool ScreenLockDetector::connectToUkuiManager() qDebug() << "ukui ScreenSaver interface is valid for session:" << sessionPath; // 连接Lock和Unlock信号到特定会话 - bool lockConnected = QDBusConnection::systemBus().connect( + bool lockConnected = QDBusConnection::sessionBus().connect( "org.ukui.ScreenSaver", sessionPath, "org.ukui.ScreenSaver", @@ -221,7 +221,7 @@ bool ScreenLockDetector::connectToUkuiManager() SLOT(onSessionLocked()) ); - bool unlockConnected = QDBusConnection::systemBus().connect( + bool unlockConnected = QDBusConnection::sessionBus().connect( "org.ukui.ScreenSaver", sessionPath, "org.ukui.ScreenSaver", @@ -469,4 +469,4 @@ void ScreenLockDetector::onSessionUnlocked() setLockState(false); } -#endif // Q_OS_LINUX \ No newline at end of file +#endif // Q_OS_LINUX