fix: prevent lock screen during screensaver preview#119
Merged
lzwind merged 1 commit intolinuxdeepin:masterfrom Jan 6, 2026
Merged
fix: prevent lock screen during screensaver preview#119lzwind merged 1 commit intolinuxdeepin:masterfrom
lzwind merged 1 commit intolinuxdeepin:masterfrom
Conversation
Fixed an issue where the lock screen would be triggered during screensaver preview mode. Added a check for m_previewing flag to ensure lock screen is not activated when previewing screensavers. The previous logic would trigger lock screen when screensaver stopped if certain conditions were met, including when the screensaver was awakened by the window itself. However, this didn't account for preview mode where users are just testing screensavers and shouldn't be locked out. Added !m_previewing condition to prevent lock screen activation during preview sessions. Log: Fixed screensaver preview triggering unintended lock screen Influence: 1. Test screensaver preview functionality - ensure preview works without locking screen 2. Test normal screensaver timeout - ensure lock screen still activates after timeout 3. Test manual lock screen activation - ensure it still works when requested 4. Verify screensaver stops correctly in both preview and normal modes 5. Test awakening from screensaver - ensure lock screen activates only when appropriate fix: 修复屏保预览时触发锁屏的问题 修复了在屏保预览模式下会触发锁屏的问题。添加了对 m_previewing 标志的检 查,确保在预览屏保时不会激活锁屏。 之前的逻辑会在屏保停止时触发锁屏,前提是满足某些条件,包括当屏保被窗口自 身唤醒时。但这没有考虑到预览模式,用户只是测试屏保效果,不应该被锁定。添 加了 !m_previewing 条件来防止在预览会话期间激活锁屏。 Log: 修复屏保预览时意外触发锁屏的问题 Influence: 1. 测试屏保预览功能 - 确保预览工作正常且不会锁定屏幕 2. 测试正常屏保超时 - 确保超时后锁屏仍然激活 3. 测试手动锁屏激活 - 确保请求锁屏时仍然正常工作 4. 验证屏保在预览和正常模式下都能正确停止 5. 测试从屏保唤醒 - 确保只在适当时机激活锁屏 PMS: BUG-345823
mhduiy
approved these changes
Jan 6, 2026
deepin pr auto review我来对这段代码的修改进行审查:
改进建议:
bool shouldLockScreen() const {
return m_lockScreenAtAwake
&& !m_lockScreenTimer.isActive()
&& !m_previewing
&& (lock || qobject_cast<ScreenSaverWindow*>(sender()));
}
qDebug() << "Checking lock screen conditions:"
<< "lockScreenAtAwake:" << m_lockScreenAtAwake
<< "timerActive:" << m_lockScreenTimer.isActive()
<< "previewing:" << m_previewing
<< "lock:" << lock;
总的来说,这是一个很好的改进,增加了预览模式的安全检查,代码质量良好,逻辑清晰。 |
lzwind
approved these changes
Jan 6, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, mhduiy, robertkill The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/merge |
Contributor
|
This pr cannot be merged! (status: unstable) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed an issue where the lock screen would be triggered during screensaver preview mode. Added a check for m_previewing flag to ensure lock screen is not activated when previewing screensavers.
The previous logic would trigger lock screen when screensaver stopped if certain conditions were met, including when the screensaver was awakened by the window itself. However, this didn't account for preview mode where users are just testing screensavers and shouldn't be locked out. Added !m_previewing condition to prevent lock screen activation during preview sessions.
Log: Fixed screensaver preview triggering unintended lock screen
Influence:
fix: 修复屏保预览时触发锁屏的问题
修复了在屏保预览模式下会触发锁屏的问题。添加了对 m_previewing 标志的检
查,确保在预览屏保时不会激活锁屏。
之前的逻辑会在屏保停止时触发锁屏,前提是满足某些条件,包括当屏保被窗口自
身唤醒时。但这没有考虑到预览模式,用户只是测试屏保效果,不应该被锁定。添
加了 !m_previewing 条件来防止在预览会话期间激活锁屏。
Log: 修复屏保预览时意外触发锁屏的问题
Influence:
PMS: BUG-345823