AGENTS.md — Window Manager (OpenHarmony)
This repo is the window management subsystem of OpenHarmony. It provides core capabilities for window and display management, serving as the foundational subsystem for UI display. See README.md for full architecture details.
What is window_manager
window_manager is a Client-Server architecture subsystem. Key modules:
wm/— Window Manager Clientdm/— Display Manager Clientwmserver/— Window Manager Server (separated arch)dmserver/— Display Manager Serverwindow_scene/— Window Manager Server (unified arch)interfaces/innerkits/— Native APIsinterfaces/kits/— JS/NAPI APIsextension/— Ability Component window integrationutils/— Shared utilities
Two compile-time architectures are selected via window_manager_use_sceneboard (set externally by the OpenHarmony build system):
| Value | Architecture | Key module compiled |
|---|---|---|
false |
Separated | wmserver/ |
true |
Unified | window_scene/ |
WorkFlow
CodeStyle specification
You must follow the CodeStyle specification when you write code.
Key rules:
- C++ standard: C++11; Column limit: 120; Indent: 4 spaces, no tabs
- Namespace: always
OHOS::Rosen - Naming: Classes
PascalCase, methodscamelCase, member varscamelCase_, constantsUPPER_SNAKE_CASE, filessnake_case - Include order: corresponding header → stdlib → OH framework →
interfaces/→ other internal - Logging:
TLOGD/TLOGI/TLOGW/TLOGE - Error handling: return
WMError/WmErrorCode; early-return withWLOGFElog - Memory:
sptr<T>for IPC/singletons,wptr<T>for weak refs; prefer RAII - Every source file must begin with the Apache 2.0 license header
Testing specification
You must follow the Testing specification after you write testing code and keep testing suite pass.
Git Commit Rules
- User approval required: Ask user before
git commit. Usegit commit -safter approval. - Angular format:
type(scope): subject(feat, fix, docs, style, refactor, test, chore) - Co-authored footer: Append
Co-Authored-By: Agentto every commit message.
Example:
feat(auth): add user login feature
Signed-off-by: Your Name <your.email@example.com>
Co-Authored-by: Agent