fix: 修复联想YOGA pro14(Ultra7)使用电源键无法关闭显示器的问题#1028
fix: 修复联想YOGA pro14(Ultra7)使用电源键无法关闭显示器的问题#1028applyforprof wants to merge 0 commit intolinuxdeepin:masterfrom
Conversation
|
Hi @applyforprof. Thanks for your PR. 😃 |
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
Hi @applyforprof. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR adjusts the X11 code path for turning off the screen so that it first enables the X screen saver and waits briefly before forcing DPMS off, improving compatibility on Lenovo YOGA Pro 14 (Ultra7) when using the power button to turn off the display. Sequence diagram for updated X11 screen power-off behaviorsequenceDiagram
actor User
participant PowerButton
participant Manager
participant XServer
participant xset
participant dpms
User ->> PowerButton: Press power button
PowerButton ->> Manager: systemTurnOffScreen()
alt Wayland_session
Manager ->> XServer: dde_wldpms -s Off
XServer -->> Manager: Screen off (Wayland)
else X11_session
Manager ->> xset: xset s on
xset -->> Manager: Result or error
Manager ->> Manager: Sleep 100ms
Manager ->> dpms: ForceLevelChecked(DPMSModeOff)
dpms -->> Manager: Screen off (DPMS)
end
Manager -->> PowerButton: Return
PowerButton -->> User: Display turned off
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The hard-coded 100ms
time.Sleepbefore callingdpms.ForceLevelCheckedis a bit of a magic value; consider either documenting why this delay is needed or extracting it into a named constant so future maintainers understand and can tune it more easily.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The hard-coded 100ms `time.Sleep` before calling `dpms.ForceLevelChecked` is a bit of a magic value; consider either documenting why this delay is needed or extracting it into a named constant so future maintainers understand and can tune it more easily.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: applyforprof 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 |
BUG: 349047
Influence: Power
Summary by Sourcery
Bug Fixes: