Skip to content

feat: add SystemDConfigManager for dconfig init#1096

Open
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:feat/systemdconfigmanager-dconfig-init
Open

feat: add SystemDConfigManager for dconfig init#1096
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:feat/systemdconfigmanager-dconfig-init

Conversation

@deepin-wm

Copy link
Copy Markdown
Contributor

Summary

Encapsulate a SystemDConfigManager class to unify ownership and initialization of system-level dconfig (TreelandConfig + TreelandUserConfig). The compositor now blocks until the global config finishes initializing (success, failure, or 5s timeout) before proceeding with business logic, ensuring configuration values are ready before they are consumed.

Changes

  • New: src/seat/systemdconfigmanager.h / systemdconfigmanager.cpp — owns both dconfig objects, provides initialize() (blocking wait), isInitializeSucceeded(), initializeSucceed signal, and resetUserConfig().
  • src/seat/helper.h / helper.cpp — replace m_config/m_globalConfig members with a single SystemDConfigManager *m_systemConfigManager; config()/globalConfig() delegate to the manager; call initialize() after storing the pointer to avoid null-pointer reentry during the nested event loop.
  • src/wallpaper/wallpapermanager.cpp — switch 8 friend-access sites from Helper::instance()->m_config-> to Helper::instance()->config()->.
  • src/CMakeLists.txt — register the two new source files.

Design notes

  • Blocking wait is split out of the constructor into initialize() so Helper can store the manager pointer first — any nested-loop callback reaching Helper::config()/globalConfig() sees a valid pointer.
  • isInitializeSucceeded() returns true only when both configs initialized successfully; failures/timeouts fall back to defaults (still safe to read).
  • Greeter ("dde" placeholder path) deliberately does not block on user config; the signal stays false by design.

Multica issue: WM-9

1. Add SystemDConfigManager to own and initialize system-level dconfig
2. Block on global config initialization before business logic runs
3. Expose isInitializeSucceeded() and initializeSucceed signal
4. Route wallpaper manager through Helper::config() accessor
5. Remove dead #if block for dconfig version checks

Log: System-level dconfig now blocks until ready before startup

Influence:
1. Verify treeland starts normally when dconfig service is running
2. Verify default values apply when dconfig init fails or times out
3. Verify user config reloads correctly on user switch
4. Verify greeter session does not block on user config

feat: 新增 SystemDConfigManager 管理系统级 dconfig 初始化

1. 新增 SystemDConfigManager 统一持有并初始化系统级 dconfig
2. 在业务逻辑执行前阻塞等待全局配置初始化完成
3. 提供 isInitializeSucceeded() 函数和 initializeSucceed 信号
4. 壁纸管理器改用 Helper::config() 访问器
5. 移除冗余的 dconfig 版本判断空块

Log: 系统级 dconfig 初始化阻塞等待完成后再启动合成器

Influence:
1. 测试 dconfig 服务正常时 treeland 能正常启动
2. 测试 dconfig 初始化失败或超时时回退默认值
3. 测试用户切换时用户配置能正确重新加载
4. 测试 greeter 场景不阻塞用户配置初始化

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @deepin-wm, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-wm

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-wm deepin-wm marked this pull request as ready for review July 2, 2026 14:16
@deepin-bot

deepin-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 0.8.14
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants