feat(dde-blackwidget): 迁移 V20 增强版黑屏组件并支持 nodbus 模式显示 logo - #451
Merged
Merged
Conversation
Reviewer's Guide本 PR 将 dde-blackwidget 迁移为基于 DConfig 的增强实现:支持 nodbus 模式直接显示 Plymouth logo、单实例锁、多屏遮罩和 X11 安全护栏,同时通过 Qt6/Dtk6DConfig 更新构建及服务安装配置,并移除原有 startdde GSettings 依赖。 Sequence diagram for dde-blackwidget startup modessequenceDiagram
participant Service as SystemdService
participant Main as dde_blackwidget
participant Lock as QLockFile
participant Window as Window
participant DConfig as DConfigHelper
participant X11 as X11
Service->>Main: start
Main->>Lock: tryLock(0)
alt lock unavailable
Lock-->>Main: false
Main-->>Service: exit
else lock acquired
Main->>Main: parse nodbus argument
Main->>Window: construct
alt nodbus mode
Main->>Window: setLogoVisible(true)
Window->>DConfig: getConfig(blackWidgetLogoVisible)
DConfig-->>Window: logo visibility
Main->>Window: raiseWindow()
else DBus mode
Main->>Window: register DBus service
end
Window->>X11: ensurePlatformReady()
Window->>Window: paintBackground()
Window->>Window: updateScreenWindows()
end
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 found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="dde-blackwidget/src/main.cpp" line_range="43-45" />
<code_context>
- a.setOrganizationName("deepin");
- a.setApplicationName("dde-blackwidget");
- a.setDesktopFileName(QStringLiteral("org.deepin.dde.blackwidget"));
+ if (qgetenv("QT_QPA_PLATFORM") != "xcb") {
+ qputenv("QT_QPA_PLATFORM", "xcb");
+ }
</code_context>
<issue_to_address>
**issue (bug_risk):** The process forcibly selects the XCB Qt platform for every session, so starting it under a Wayland session without a usable Xwayland display causes QApplication initialization to fail and the black-screen overlay never appears.
**Triggers:** When the system is running Wayland and Xwayland is unavailable or its display cannot be opened.
**Suggested fix:** Only force XCB when the environment provides a usable X11 display, or retain a supported Wayland platform path.
```suggestion
if (qgetenv("QT_QPA_PLATFORM").isEmpty() && !qgetenv("DISPLAY").isEmpty()) {
qputenv("QT_QPA_PLATFORM", "xcb");
}
```
</issue_to_address>
### Comment 2
<location path="dde-blackwidget/src/window.cpp" line_range="229-235" />
<code_context>
+ return;
+ }
+
+ QScreen *currentScreen = qApp->primaryScreen();
+ if (!currentScreen) {
+ currentScreen = screens.first();
+ qWarning() << "primary screen is null, use first screen:" << currentScreen;
+ }
+
+ const QRect currentGeometry = currentScreen->geometry();
+ if (geometry().topLeft() != currentGeometry.topLeft()) {
+ move(currentGeometry.topLeft());
+ }
+ if (size() != currentGeometry.size()) {
+ setFixedSize(currentGeometry.size());
+ }
+
</code_context>
<issue_to_address>
**issue (bug_risk):** The Show event calls setupSize(), which unconditionally invokes updateScreenWindows() and resizes the main window to the primary screen geometry after paintBackground() set it to 10000x10000 for gravity-rotate mode; the rotation blackout therefore no longer covers the intended oversized area.
**Triggers:** When gravity-rotate-black-enabled is true.
**Suggested fix:** Preserve the 10000x10000 size in updateScreenWindows or skip the per-screen sizing path while gravity-rotate mode is active.
```suggestion
const QRect currentGeometry = currentScreen->geometry();
if (geometry().topLeft() != currentGeometry.topLeft()) {
move(currentGeometry.topLeft());
}
if (!m_gravityRotateBlackEnabled && size() != currentGeometry.size()) {
setFixedSize(currentGeometry.size());
}
```
</issue_to_address>
mhduiy
force-pushed
the
feat-blackwidget-nodbus-dconfig
branch
7 times, most recently
from
September 8, 2026 05:47
2487af6 to
428f916
Compare
1. Port the V20 black widget with DTK-managed single-instance startup, nodbus mode, and multi-screen X11 coverage. 2. Load the Plymouth logo and shutdown text from one smart-pointer-owned DConfig instance, with logo display enabled by default. 3. Install a Type=exec nodbus user service that remains active after graphical-session.target stops. 4. Use DTK platform detection for X11-specific window flags and input grabs while retaining explicit Treeland extension points. 5. Remove the obsolete gravity-rotate path and redundant platform-readiness wrappers. 6. Add REUSE metadata for DConfig JSON files and normalize new-file copyright years. Log: Add a nodbus shutdown overlay that displays Plymouth branding until handoff. Influence: Reduce the blank interval during shutdown. feat(dde-blackwidget): 支持 nodbus 关机遮罩 1. 迁移 V20 黑屏组件,使用 DTK 管理单实例启动,并支持 nodbus 模式和 X11 多屏覆盖。 2. 通过智能指针管理的单一 DConfig 实例加载 Plymouth logo 和关机文字,并默认显示 logo。 3. 安装 Type=exec nodbus 用户服务,并在 graphical-session.target 停止后继续运行。 4. 使用 DTK 平台检测处理 X11 窗口标志和输入抓取,同时保留明确的 Treeland 扩展入口。 5. 移除废弃的 gravity-rotate 路径和重复的平台就绪包装逻辑。 6. 为 DConfig JSON 文件补充 REUSE 元数据并规范新增文件版权年份。 Log: 新增 nodbus 关机遮罩,在 Plymouth 接管前显示品牌 logo。 PMS: TASK-395319 Influence: 减少关机过程中的纯黑空档。 Change-Id: I85a52a82648f9588a424e8e63f641712117dfaa0
mhduiy
force-pushed
the
feat-blackwidget-nodbus-dconfig
branch
from
September 8, 2026 08:45
428f916 to
213a382
Compare
yixinshark
approved these changes
Sep 8, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy, yixinshark 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更内容
blackWidgetLogoVisible默认开启Type=exec的dde-blackwidget-nodbus.service,不绑定graphical-session.target的停止生命周期DISPLAY时选择 XCB,并移除无效的 gravity-rotate 路径REUSE.toml中以 CC0-1.0 标注 DConfig JSON 元数据PMS: TASK-395319
Influence: 关机/重启时显示 Plymouth logo 黑屏,取代纯黑空档