feat(power): add session power management plugin#70
Conversation
There was a problem hiding this comment.
Sorry @mhduiy, your pull request is larger than the review limit of 150000 diff characters
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
03b4d33 to
b366fc3
Compare
|
/test all |
d8b02df to
c71fe7c
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new Qt-based power management plugin under src/plugin-qt/power/, exposing org.deepin.dde.Power1 and implementing session-level power/idle/screen control (Wayland-focused), plus scaffolding for a system-side implementation.
Changes:
- Introduce a session power manager with idle detection (Wayland), screen power/brightness control, low-power policy handling, lid switch actions, and scheduled shutdown.
- Add Wayland protocol client integrations (ext-idle-notify, wlr output power management, treeland brightness) and translation resources.
- Add D-Bus/systemd service descriptors and update build/install wiring (plus new Debian build-deps).
Reviewed changes
Copilot reviewed 61 out of 61 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/plugin-qt/power/system/systemdbusproxy.h | Add small system-bus proxy API (chassis/lid queries). |
| src/plugin-qt/power/system/systemdbusproxy.cpp | Implement hostname1/UPower property reads. |
| src/plugin-qt/power/system/powermanager.h | Add system-side org.deepin.dde.Power1 manager interface (battery/lid/mode properties). |
| src/plugin-qt/power/system/powermanager.cpp | Implement system-side D-Bus object registration and mode/lid/battery wiring. |
| src/plugin-qt/power/system/plugin-power-system.cpp | Add DSM plugin entrypoints for system plugin. |
| src/plugin-qt/power/system/misc/plugin-power-system.json | Add system plugin descriptor for deepin-service-manager. |
| src/plugin-qt/power/system/misc/org.deepin.dde.Power1.service | Add systemd unit for system D-Bus service. |
| src/plugin-qt/power/system/misc/dbus/org.deepin.dde.Power1.service | Add system D-Bus activation service file. |
| src/plugin-qt/power/system/CMakeLists.txt | Add build/install rules for system plugin (currently not enabled by parent CMake). |
| src/plugin-qt/power/system/batterymanager.h | Add udev/sysfs battery monitoring interface. |
| src/plugin-qt/power/system/batterymanager.cpp | Implement sysfs battery polling + udev monitoring. |
| src/plugin-qt/power/session/translations/plugin-power-session_az.ts | Add session plugin translation file (az). |
| src/plugin-qt/power/session/translations/plugin-power-session_bo.ts | Add session plugin translation file (bo). |
| src/plugin-qt/power/session/translations/plugin-power-session_ca.ts | Add session plugin translation file (ca). |
| src/plugin-qt/power/session/translations/plugin-power-session_en.ts | Add session plugin translation file (en). |
| src/plugin-qt/power/session/translations/plugin-power-session_en_US.ts | Add session plugin translation file (en_US). |
| src/plugin-qt/power/session/translations/plugin-power-session_es.ts | Add session plugin translation file (es). |
| src/plugin-qt/power/session/translations/plugin-power-session_fi.ts | Add session plugin translation file (fi). |
| src/plugin-qt/power/session/translations/plugin-power-session_fr.ts | Add session plugin translation file (fr). |
| src/plugin-qt/power/session/translations/plugin-power-session_hu.ts | Add session plugin translation file (hu). |
| src/plugin-qt/power/session/translations/plugin-power-session_it.ts | Add session plugin translation file (it). |
| src/plugin-qt/power/session/translations/plugin-power-session_ja.ts | Add session plugin translation file (ja). |
| src/plugin-qt/power/session/translations/plugin-power-session_ko.ts | Add session plugin translation file (ko). |
| src/plugin-qt/power/session/translations/plugin-power-session_nb_NO.ts | Add session plugin translation file (nb_NO). |
| src/plugin-qt/power/session/translations/plugin-power-session_pl.ts | Add session plugin translation file (pl). |
| src/plugin-qt/power/session/translations/plugin-power-session_pt_BR.ts | Add session plugin translation file (pt_BR). |
| src/plugin-qt/power/session/translations/plugin-power-session_ru.ts | Add session plugin translation file (ru). |
| src/plugin-qt/power/session/translations/plugin-power-session_uk.ts | Add session plugin translation file (uk). |
| src/plugin-qt/power/session/translations/plugin-power-session_zh_CN.ts | Add session plugin translation file (zh_CN). |
| src/plugin-qt/power/session/translations/plugin-power-session_zh_HK.ts | Add session plugin translation file (zh_HK). |
| src/plugin-qt/power/session/translations/plugin-power-session_zh_TW.ts | Add session plugin translation file (zh_TW). |
| src/plugin-qt/power/session/sleepinhibitor.h | Add logind inhibitor helper interface. |
| src/plugin-qt/power/session/sleepinhibitor.cpp | Implement logind sleep inhibition + sleep/wake signals. |
| src/plugin-qt/power/session/sessiondbusproxy.h | Add session/system bus proxy wrapper for dependent services. |
| src/plugin-qt/power/session/sessiondbusproxy.cpp | Implement D-Bus proxy calls/signals for power/session/notify/display/etc. |
| src/plugin-qt/power/session/screen/screencontroller.h | Add abstract screen power/brightness control interface. |
| src/plugin-qt/power/session/screen/screencontroller.cpp | Implement shared helpers (setAllModes/isAllOff). |
| src/plugin-qt/power/session/screen/screencontroller_x11.cpp | Add X11 backend stub (not yet implemented). |
| src/plugin-qt/power/session/screen/screencontroller_wl.h | Add Wayland backend declarations for DPMS + treeland brightness. |
| src/plugin-qt/power/session/screen/screencontroller_wl.cpp | Implement Wayland output discovery, power control, brightness animation. |
| src/plugin-qt/power/session/powersaveplan.h | Add idle-driven task planner (screensaver/lock/black/sleep + brightness drop). |
| src/plugin-qt/power/session/powersaveplan.cpp | Implement idle task scheduling and brightness-drop logic. |
| src/plugin-qt/power/session/powermanager.h | Add session-level org.deepin.dde.Power1 manager API and state. |
| src/plugin-qt/power/session/powermanager.cpp | Implement session power logic: DConfig bindings, idle/screen/lid/low-power, scheduled shutdown. |
| src/plugin-qt/power/session/plugin-power-session.cpp | Add DSM plugin entrypoints + translation loading (Wayland-only runtime enable). |
| src/plugin-qt/power/session/misc/plugin-power-session.json | Add user-session plugin descriptor. |
| src/plugin-qt/power/session/misc/org.deepin.dde.Power1.service | Add session systemd unit for D-Bus service. |
| src/plugin-qt/power/session/misc/dbus/org.deepin.dde.Power1.service | Add session D-Bus activation service file. |
| src/plugin-qt/power/session/lowpowermanager.h | Add low power policy manager interface. |
| src/plugin-qt/power/session/lowpowermanager.cpp | Implement low power notification/lock/UI + auto sleep/hibernate. |
| src/plugin-qt/power/session/lidswitchhandler.h | Add lid switch handler interface. |
| src/plugin-qt/power/session/lidswitchhandler.cpp | Implement lid close/open actions with debounce and DPMS/black-screen handling. |
| src/plugin-qt/power/session/idle/idlewatcher.h | Add abstract idle watcher interface. |
| src/plugin-qt/power/session/idle/idlewatcher_x11.cpp | Add X11 backend stub (not yet implemented). |
| src/plugin-qt/power/session/idle/idlewatcher_wl.h | Add Wayland idle-notify backend declarations. |
| src/plugin-qt/power/session/idle/idlewatcher_wl.cpp | Implement Wayland idle notification setup and caching. |
| src/plugin-qt/power/session/CMakeLists.txt | Add build rules for session plugin, Wayland protocol generation, and translations. |
| src/plugin-qt/power/powerconstants.h | Add shared DConfig keys, D-Bus constants, and filesystem paths. |
| src/plugin-qt/power/CMakeLists.txt | Add power plugin subtree (session enabled; system commented out). |
| src/plugin-qt/CMakeLists.txt | Wire power plugin into plugin-qt build. |
| debian/control | Add Qt Wayland/protocol and tools build dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
701efd4 to
d65fb61
Compare
1. Add new session-level power management plugin with org.deepin.dde.Power1 DBus service 2. Implement power save plan management with balance, performance, and power saver modes 3. Add low power notification and auto-sleep with configurable percentage and time thresholds 4. Implement idle detection (Wayland + X11), screen dimming/off/turn-off control 5. Add lid switch handler and sleep inhibitor mechanism for active operations 6. Include 20+ language translations and DBus service configuration files 7. Add qt6-tools-dev-tools and libudev-dev build dependencies Log: Add session-level power management plugin with DBus service, power save plans, low power management, idle detection, and screen control feat(power): 添加会话级电源管理插件 1. 新增会话级电源管理插件,提供 org.deepin.dde.Power1 DBus 服务接口 2. 实现电源节能方案管理,支持平衡、高性能、节能三种模式 3. 添加低电量通知与自动休眠功能,支持百分比和时间阈值配置 4. 实现空闲检测(Wayland 和 X11),支持屏幕调暗、熄屏、关闭显示器控制 5. 添加合盖事件处理和活跃操作防休眠机制 6. 包含 20+ 语言翻译文件及 DBus 服务配置文件 7. 新增 qt6-tools-dev-tools 和 libudev-dev 编译依赖 Log: 添加会话级电源管理插件,包含 DBus 服务、节能方案、低电量管理、空闲检测及屏幕控制 PMS: BUG-346597 PMS: BUG-346589 PMS: BUG-346575
deepin pr auto review这份代码实现了一个功能丰富的 DDE 电源管理模块,涵盖了 Wayland/X11 的空闲检测、屏幕控制、电池监控、低电量处理、定时关机以及 CPU 调度策略等功能。整体架构清晰,模块划分合理。 但在语法逻辑、代码质量、性能和安全性方面,存在一些需要改进和注意的地方。以下是详细的审查意见: 一、 语法与逻辑问题
二、 代码质量与可维护性
三、 性能问题
四、 安全性问题
总结建议
|
Log: Add session-level power management plugin with DBus service, power save plans, low power management, idle detection, and screen control
feat(power): 添加会话级电源管理插件
Log: 添加会话级电源管理插件,包含 DBus 服务、节能方案、低电量管理、空闲检测及屏幕控制
PMS: BUG-346597
PMS: BUG-346589
PMS: BUG-346575