fix: disable xembed tray selection manager registeration#459
Open
BLumia wants to merge 1 commit into
Open
Conversation
The current FdoSelectionManager is for preparing the legacy xembed2sni solution. We currently no longer plans to go with such solution, but the current code will register `_NET_SYSTEM_TRAY_S0`. This patch disabled related code path so it won't gets registered. We should do registeration from dde-daemon instead. 注:此patch并不直接解决下面关联的PMS问题单,只是有相关性,是相关工作的 一部分. PMS: BUG-360349 Log:
deepin pr auto review你好!我是CodeGeeX,你的智能编程助手。我已经仔细审查了你提供的 Git Diff。 这次修改的主要目的是通过宏 以下是我从语法逻辑、代码质量、代码性能和代码安全四个维度提出的审查意见和改进建议: 1. 语法与逻辑
2. 代码质量
3. 代码性能
4. 代码安全
综合修改建议结合以上分析,我为你提供一份优化后的代码片段: xembedprotocolhandler.h: // SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef XEMBEDPROTOCOLHANDLER_H
#define XEMBEDPROTOCOLHANDLER_H
#include <xcb/composite.h>
#include <xcb/xcb_image.h>
// FDO selection manager registration is handled by dde-daemon.
// If enabled here, tray context menu positioning must also be handled correctly.
// Consider moving FdoSelectionManager to dde-shell in the future.
#ifndef DDE_TRAY_LOADER_HANDLE_XEMBED_SELECTION_MANAGER
#define DDE_TRAY_LOADER_HANDLE_XEMBED_SELECTION_MANAGER 0
#endif
#if DDE_TRAY_LOADER_HANDLE_XEMBED_SELECTION_MANAGER
class FdoSelectionManager;
#endif
namespace tray {
class XembedProtocol : public AbstractTrayProtocol, public QAbstractNativeEventFilter
{
// ...
#if DDE_TRAY_LOADER_HANDLE_XEMBED_SELECTION_MANAGER
FdoSelectionManager *m_selectionManager = nullptr;
#endif
};
}
#endif // XEMBEDPROTOCOLHANDLER_Hxembedprotocolhandler.cpp: #include "abstracttrayprotocol.h"
#include "traymanager1interface.h"
#include "xembedprotocolhandler.h"
#if DDE_TRAY_LOADER_HANDLE_XEMBED_SELECTION_MANAGER
#include "fdoselectionmanager.h"
#endif
#include "util.h"
#include "plugin.h"
// ... 其他代码 ...
XembedProtocol::XembedProtocol(QObject *parent)
: AbstractTrayProtocol(parent)
{
// ... 其他初始化 ...
QMetaObject::invokeMethod(this, &XembedProtocol::onTrayIconsChanged, Qt::QueuedConnection);
#if DDE_TRAY_LOADER_HANDLE_XEMBED_SELECTION_MANAGER
// 注意:修复了 isXAvaliable 的拼写错误 -> isXAvailable
if ((qgetenv("XDG_SESSION_TYPE") == "wayland") && UTIL->isXAvailable()) {
qWarning() << "Not running on X11, registering FDO selection manager";
m_selectionManager = new FdoSelectionManager(this);
}
#else
if (qgetenv("XDG_SESSION_TYPE") == "wayland") {
qDebug() << "Skipping FDO selection manager registration (disabled by macro).";
}
#endif
QTimer::singleShot(0, this, [this](){
m_trayManager->Manage();
});
}希望这些审查意见和代码改进能对你有所帮助!如果有任何疑问,欢迎随时提问。 |
tsic404
approved these changes
May 19, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, tsic404 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.
The current FdoSelectionManager is for preparing the legacy xembed2sni solution. We currently no longer plans to go with such solution, but the current code will register
_NET_SYSTEM_TRAY_S0. This patch disabled related code path so it won't gets registered. We should do registeration from dde-daemon instead.注:此patch并不直接解决下面关联的PMS问题单,只是有相关性,是相关工作的
一部分.
PMS: BUG-360349