Repository navigation
fix(power): backport screen-off stall fix to 2500u2 - #233
Conversation
Reviewer's GuideUses of the APIMake both LockFront ShowAuth requests fire-and-forget so callers do not block while LockFront reads Power1, and remove the now-unused cached interface.
ImplementationBlank the display before requesting the lock so the lock flow cannot delay the screen-off operation.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/plugin-qt/shortcut/tools/dde-shortcut-tool/powercontroller.cpp" line_range="280" />
<code_context>
- lockFront.call("ShowAuth", autoStartAuth);
+ // Fire and forget: LockFront reads Power1 back, so waiting for its reply
+ // from a key handler only risks the 25s D-Bus timeout.
+ lockFront.asyncCall("ShowAuth", autoStartAuth);
}
</code_context>
<issue_to_address>
**Session suspends before locking**
When lockFront takes longer than the 500 ms suspend pause to establish the lock, `PowerController::doLock()` returns after queuing `ShowAuth`, so `handleSystemSuspend()` proceeds to `systemSuspend()` while LockFront is still handling the request; the machine suspends with the session unlocked.
Wait for the lock to be established before proceeding with suspend.
Also at `src/plugin-qt/power/session/sessiondbusproxy.cpp:343`.
</issue_to_address>| lockFront.call("ShowAuth", autoStartAuth); | ||
| // Fire and forget: LockFront reads Power1 back, so waiting for its reply | ||
| // from a key handler only risks the 25s D-Bus timeout. | ||
| lockFront.asyncCall("ShowAuth", autoStartAuth); |
There was a problem hiding this comment.
🟠 High · Session suspends before locking
When lockFront takes longer than the 500 ms suspend pause to establish the lock, PowerController::doLock() returns after queuing ShowAuth, so handleSystemSuspend() proceeds to systemSuspend() while LockFront is still handling the request; the machine suspends with the session unlocked.
Wait for the lock to be established before proceeding with suspend.
Also at src/plugin-qt/power/session/sessiondbusproxy.cpp:343.
Prompt for AI agents
In `src/plugin-qt/shortcut/tools/dde-shortcut-tool/powercontroller.cpp` at line 280:
**Session suspends before locking**
When lockFront takes longer than the 500 ms suspend pause to establish the lock, `PowerController::doLock()` returns after queuing `ShowAuth`, so `handleSystemSuspend()` proceeds to `systemSuspend()` while LockFront is still handling the request; the machine suspends with the session unlocked.
Wait for the lock to be established before proceeding with suspend.
Also at `src/plugin-qt/power/session/sessiondbusproxy.cpp:343`.1. TurnOffScreen waited for LockFront ShowAuth while dde-lock read Power1 SleepLock back, so both sides stalled until the 25s D-Bus timeout and the display stayed lit the whole time. 2. SessionDBusProxy::showLockAuth fire-and-forgets ShowAuth now, and the X11 turn-off path blanks the screen before requesting the lock. 3. dde-shortcut-tool's power controller uses the same async ShowAuth call, so the power-button shortcut no longer blocks its key handler. Log: Blank the screen immediately instead of waiting for LockFront. Influence: 1. Press the power button: the display blanks immediately; journalctl shows no 25s gap between "Locking session" and "Setting DPMS mode to off". 2. Lock/unlock, suspend/resume, hibernate and shutdown still work. 3. Repeat screen-off after a suspend/resume cycle and confirm the display still blanks immediately. fix(power): 修复锁屏回读导致关屏延迟 25 秒 1. TurnOffScreen 同步等待 LockFront ShowAuth,而 dde-lock 在 ShowAuth 中回读 Power1 SleepLock,双方互等到 25 秒 D-Bus 超时,期间屏幕 一直亮着。 2. SessionDBusProxy::showLockAuth 改为异步发送 ShowAuth 后立即返回, X11 关屏路径先关闭显示器再请求锁屏。 3. dde-shortcut-tool 的电源控制器同样改为异步调用 ShowAuth,按电源键 不再阻塞快捷键处理。 Log: 立即关闭显示器,不再等待 LockFront 返回。 Influence: 1. 按电源键后显示器立即熄灭;journalctl 中 "Locking session" 到 "Setting DPMS mode to off" 不再有 25 秒间隔。 2. 锁屏/解锁、待机/唤醒、休眠、关机功能正常。 3. 待机/唤醒后再按一次电源键,确认显示器仍立即关闭。 (cherry picked from commit 308d430) Log: Blank the screen immediately instead of waiting for LockFront. PMS: BUG-382691
ef5c1d2 to
5a05216
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fly602, mhduiy 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 |
来源与目标
308d430e23da85b059e8d74120c618be493e14b8linuxdeepin/dde-services:release/2500u2变更
SessionDBusProxy::showLockAuth()按原 PR 使用原始异步 D-Bus 消息,不等待 LockFront 的回复。PowerController::doLock()改为异步调用ShowAuth。目标分支的
showLockAuth()仍使用缓存的DDBusInterface,因此该处 cherry-pick 有冲突。已采用原 PR 的异步消息实现,并删除因此不再使用的 LockFront 缓存接口及成员声明;不引入 master 上的其他提交。验证
plugin-power-session、dde-shortcut-tool、tst-screensaverproxy编译通过。ctest -R '^power-screensaver-proxy$' --output-on-failure:1/1 通过。ShowAuth时,SessionDBusProxy::showLockAuth()与PowerController::doLock()均在 0 ms 返回;LockFront 均成功回读Power1.SleepLock。验证脚本不包含在提交中。未执行真实会话的关屏、锁屏/解锁、待机/唤醒、休眠与关机验证;私有 D-Bus 和 offscreen 验证不会触发实际锁屏或关屏。
仅通过此 PR 回移修复,不直接更新目标分支,不启用自动合并。
Summary by Sourcery
Prevent screen-off operations from being blocked by synchronous lock-auth requests.
Bug Fixes:
Enhancements: