fix(wallpaperslideshow): skip DBus registration on Wayland, handled b…#71
Conversation
…y Treeland 1. Check XDG_SESSION_TYPE in DSMRegister and return early under Wayland 2. Treeland compositor manages wallpaper slideshow on Wayland sessions 3. Align with the same Wayland-guard pattern used in xsettings module Log: Skip wallpaper slideshow DBus registration on Wayland, where Treeland handles it fix(wallpaperslideshow): Wayland 下跳过壁纸轮播 DBus 注册,由 Treeland 处理 1. 在 DSMRegister 中检查 XDG_SESSION_TYPE,Wayland 下提前返回 2. Wayland 会话中壁纸轮播由 Treeland 合成器负责 3. 与 xsettings 模块中已有的 Wayland 守卫模式保持一致 Log: Wayland 下壁纸轮播由 Treeland 负责,跳过 DBus 注册
deepin pr auto review你好!我是CodeGeeX。我已仔细审查了你提供的Git Diff,下面我将从语法逻辑、代码质量、代码性能和代码安全四个维度对该代码变更进行详细的审查,并提出改进意见。 总体评价此次代码变更的主要目的是:在Wayland环境下阻止 一、 语法与逻辑
二、 代码质量
三、 代码性能
四、 代码安全
综合改进建议代码结合以上分析,我为你提供一份优化后的代码参考: // SPDX-FileCopyrightText: 2025 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#include <QDebug> // 确保包含日志头文件
extern "C" int DSMRegister(const char *name, void *data)
{
Q_UNUSED(name)
Q_UNUSED(data)
// 优化1:添加注释说明原因
// Note: WallpaperSlideshow relies on X11 specific features.
// Skip registration on Wayland to avoid conflicts or crashes.
if (qEnvironmentVariable("XDG_SESSION_TYPE") == QStringLiteral("wayland")) {
// 优化2:添加日志,使得排查问题时有迹可循
qDebug() << "WallpaperSlideshow: Skipping registration on Wayland session.";
// 优化3:如果框架允许,建议返回非0值表示未注册;若必须返回0,则保留0。
return 0;
}
service = new WallpaperSlideshow();
new WallpaperSlideshowAdaptor(service);
bool wallpaperSlideshowRegister = QDBusConnection::sessionBus().registerService(WALLPAPER_SLIDESHOW_SERVICE);
// ... 后续逻辑
}主要改动点说明:
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy, robertkill 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 |
|
轮播壁纸后续在Treeland实现,这里屏蔽 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
…y Treeland
Log: Skip wallpaper slideshow DBus registration on Wayland, where Treeland handles it
fix(wallpaperslideshow): Wayland 下跳过壁纸轮播 DBus 注册,由 Treeland 处理
Log: Wayland 下壁纸轮播由 Treeland 负责,跳过 DBus 注册