Enable Login Manager and stop emitting unlock

Call connectToLoginManager() in initialize(). Comment out
lockStateChanged and screenUnlocked emissions to silence them.
This commit is contained in:
ubuntu1804 2025-11-08 10:51:45 +08:00
parent e6fec6dfea
commit 7e919ddef9
1 changed files with 62 additions and 63 deletions

View File

@ -48,8 +48,7 @@ bool ScreenLockDetector::initialize()
// 尝试连接到不同的DBus接口
bool deepinOk = connectToDeepinDDE();
bool gnomeOk = connectToGnomeScreenSaver();
//bool loginOk = connectToLoginManager();
bool loginOk = false;
bool loginOk = connectToLoginManager();
if (!deepinOk && !gnomeOk && !loginOk) {
qWarning() << "Failed to connect to any screen lock detection service";
@ -79,12 +78,12 @@ void ScreenLockDetector::setLockState(bool locked)
qDebug() << "## Screen lock state changed:" << (locked ? "LOCKED" : "UNLOCKED");
qDebug() << "##################################################";
emit lockStateChanged(locked);
// emit lockStateChanged(locked);
if (locked) {
emit screenLocked();
} else {
emit screenUnlocked();
// emit screenUnlocked();
}
}
}