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接口 // 尝试连接到不同的DBus接口
bool deepinOk = connectToDeepinDDE(); bool deepinOk = connectToDeepinDDE();
bool gnomeOk = connectToGnomeScreenSaver(); bool gnomeOk = connectToGnomeScreenSaver();
//bool loginOk = connectToLoginManager(); bool loginOk = connectToLoginManager();
bool loginOk = false;
if (!deepinOk && !gnomeOk && !loginOk) { if (!deepinOk && !gnomeOk && !loginOk) {
qWarning() << "Failed to connect to any screen lock detection service"; 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() << "## Screen lock state changed:" << (locked ? "LOCKED" : "UNLOCKED");
qDebug() << "##################################################"; qDebug() << "##################################################";
emit lockStateChanged(locked); // emit lockStateChanged(locked);
if (locked) { if (locked) {
emit screenLocked(); emit screenLocked();
} else { } else {
emit screenUnlocked(); // emit screenUnlocked();
} }
} }
} }