Skip to content

Commit 79ea308

Browse files
committed
fix: 统一锁屏激活逻辑
移除 ENABLE_DSS_SNIPE 条件编译的锁屏激活代码,将所有锁屏激活逻辑统一到 login1 会话 ActiveChanged 信号下。DSS snipe 功能导致锁屏行为不一致和重 复的激活逻辑。现在所有锁屏激活都通过 login1 会话管理器的活动状态变化来处 理,确保不同会话类型下行为一致。 此更改还移除了 pushUserFrame 中的显式模型可见性设置,因为锁屏激活逻辑现 在通过统一的激活机制正确处理可见性。 Influence: 1. 测试系统锁定时锁屏激活功能 2. 验证会话激活时锁屏正确显示 3. 测试用户切换功能仍然正常工作 4. 验证会话未激活时锁屏不会显示 5. 测试不同会话类型下的一致性 PMS: BUG-341543
1 parent 740630f commit 79ea308

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/dde-lock/lockworker.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,6 @@ void LockWorker::initConnections()
138138
emit m_model->authFinished(true);
139139
});
140140

141-
#ifdef ENABLE_DSS_SNIPE
142-
connect(m_sessionManagerInter, &SessionManagerInter::LockedChanged, this, [ this ](bool locked) {
143-
qDebug() << "SessionManagerInter::LockedChanged" << locked;
144-
if (locked && !m_model->visible()) {
145-
m_model->showLockScreen();
146-
}
147-
});
148-
#endif
149-
150141
/* org.freedesktop.login1.Session */
151142
connect(m_login1SessionSelf, &Login1SessionSelf::ActiveChanged, this, [this](bool active) {
152143
qCInfo(DDE_SHELL) << "DBus lock service active changed, active: " << active << ", model visible: " << m_model->visible();
@@ -161,6 +152,12 @@ void LockWorker::initConnections()
161152
endAuthentication(m_account, AT_All);
162153
destroyAuthentication(m_account);
163154
}
155+
156+
#ifdef ENABLE_DSS_SNIPE
157+
if (active && !m_model->visible()) {
158+
m_model->showLockScreen();
159+
}
160+
#endif
164161
});
165162

166163
// 在待机时启动定时器,如果定时器超时的时间离待机时间大于15秒,则认为已经唤醒,停止定时器,并设置黑屏模式为false

0 commit comments

Comments
 (0)