fix: remove shot-start-plugin from wayland blacklist#458
Merged
Conversation
Remove "libshot-start-plugin.so" from the list of plugins blacklisted under the Wayland session. The plugin is now compatible with Wayland, allowing it to load and function properly on Wayland-based systems. Log: Removed wayland blacklist entry for shot-start-plugin Influence: 1. Verify the shot-start plugin loads successfully on Wayland systems 2. Test basic functionality of the shot-start plugin under Wayland 3. Ensure no regression on X11 systems fix: 从 wayland 黑名单中移除 shot-start-plugin 从 Wayland 会话下的插件黑名单中移除 "libshot-start-plugin.so"。该插件现 已兼容 Wayland,允许其在基于 Wayland 的系统上正常加载和运行。 Log: 移除 shot-start-plugin 的 wayland 黑名单配置 Influence: 1. 验证 shot-start 插件在 Wayland 系统上成功加载 2. 在 Wayland 下测试 shot-start 插件的基本功能 3. 确保在 X11 系统上没有回归问题 PMS: BUG-345077
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves the Wayland blacklist entry for the shot-start plugin so it can load under Wayland, and updates the file copyright years; blacklist still includes other problematic plugins. Flow diagram for PluginManager::loadPlugin Wayland blacklist changeflowchart TD
A["PluginManager::loadPlugin(pluginFilePath)"] --> B{"qgetenv(XDG_SESSION_TYPE) == wayland"}
B -- no --> C[Load plugin from pluginFilePath]
B -- yes --> D[Initialize blacklistedPluginPaths<br/>- libshot-start-record-plugin.so<br/>- libdeepin-screen-recorder-plugin.so<br/>- libeye-comfort-mode.so]
D --> E{pluginFilePath in blacklistedPluginPaths?}
E -- yes --> F[Skip loading plugin]
E -- no --> C[Load plugin from pluginFilePath]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review你好!我是CodeGeeX,你的智能编程助手。我已经仔细审查了你提供的 Git Diff 输入。下面我将从语法逻辑、代码质量、代码性能和代码安全四个方面对这次代码变更进行审查,并给出改进意见。 变更概述这次修改主要包含两处:
审查意见1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
改进建议与重构代码针对性能和质量问题,建议将 Wayland 黑名单提取为类的静态成员或在使用时仅初始化一次,避免在 改进后的代码示例: // 在头文件 pluginmanager.h 中
class PluginManager {
private:
// 将黑名单设为静态成员,或者使用局部静态变量延迟初始化
static const QStringList& getWaylandBlacklist();
static bool isWaylandSession();
};
// 在 pluginmanager.cpp 中
bool PluginManager::isWaylandSession() {
// 使用局部静态变量,整个进程生命周期内只读取一次环境变量
static bool isWayland = (qgetenv("XDG_SESSION_TYPE") == "wayland");
return isWayland;
}
const QStringList& PluginManager::getWaylandBlacklist() {
// 使用局部静态变量,仅初始化一次,避免重复构造 QStringList
static const QStringList waylandBlacklist = {
"libshot-start-record-plugin.so",
"libshot-start-plugin.so", // 注意:此插件已确认适配Wayland,从黑名单移除(根据你的需求决定是否保留)
"libdeepin-screen-recorder-plugin.so",
"libeye-comfort-mode.so"
};
return waylandBlacklist;
}
void PluginManager::loadPlugin(const QString &pluginFilePath)
{
// ... 其他逻辑 ...
// 优化后的判断逻辑
if (isWaylandSession()) {
// 获取黑名单,此时不再每次构造临时对象
const QStringList& blacklistedPluginPaths = getWaylandBlacklist();
// 提取文件名进行比对
QString fileName = QFileInfo(pluginFilePath).fileName();
if (blacklistedPluginPaths.contains(fileName)) {
qDebug() << "Plugin blacklisted on Wayland:" << fileName;
return; // 或者执行其他屏蔽逻辑
}
}
// ... 继续加载插件的逻辑 ...
}总结
|
BLumia
approved these changes
May 14, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia 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.
Remove "libshot-start-plugin.so" from the list of plugins blacklisted
under the Wayland session. The plugin is now compatible with Wayland,
allowing it to load and function properly on Wayland-based systems.
Log: Removed wayland blacklist entry for shot-start-plugin
Influence:
fix: 从 wayland 黑名单中移除 shot-start-plugin
从 Wayland 会话下的插件黑名单中移除 "libshot-start-plugin.so"。该插件现
已兼容 Wayland,允许其在基于 Wayland 的系统上正常加载和运行。
Log: 移除 shot-start-plugin 的 wayland 黑名单配置
Influence:
PMS: BUG-345077
Summary by Sourcery
Allow the shot-start plugin to load under Wayland by removing it from the Wayland-specific plugin blacklist.
Bug Fixes:
Enhancements: