Skip to content

Commit d1195e3

Browse files
committed
fix: disable xembed tray selection manager registeration
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:
1 parent 8d899fd commit d1195e3

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

plugins/application-tray/xembedprotocolhandler.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
#include "abstracttrayprotocol.h"
66
#include "traymanager1interface.h"
77
#include "xembedprotocolhandler.h"
8+
9+
#if _DDE_TRAY_LOADER_HANDLE_XEMBED_SELECTION_MANAGER
810
#include "fdoselectionmanager.h"
11+
#endif // _DDE_TRAY_LOADER_HANDLE_XEMBED_SELECTION_MANAGER
912

1013
#include "util.h"
1114
#include "plugin.h"
@@ -41,10 +44,12 @@ XembedProtocol::XembedProtocol(QObject *parent)
4144

4245
QMetaObject::invokeMethod(this, &XembedProtocol::onTrayIconsChanged, Qt::QueuedConnection);
4346

47+
#if _DDE_TRAY_LOADER_HANDLE_XEMBED_SELECTION_MANAGER
4448
if ((qgetenv("XDG_SESSION_TYPE") == "wayland") && UTIL->isXAvaliable()) {
4549
qWarning() << "Not running on X11, registering FDO selection manager";
4650
m_selectionManager = new FdoSelectionManager(this);
4751
}
52+
#endif // _DDE_TRAY_LOADER_HANDLE_XEMBED_SELECTION_MANAGER
4853

4954
QTimer::singleShot(0, this, [this](){
5055
m_trayManager->Manage();

plugins/application-tray/xembedprotocolhandler.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
#include <xcb/composite.h>
1717
#include <xcb/xcb_image.h>
1818

19+
// dde-daemon handles tray selection-manager registeration so we don't (and shouldn't) need this.
20+
// Also, if we need to register the FDO selection manager, we also need to ensure tray context menu
21+
// position can be handled correctly. The whole FdoSelectionManager stuff might be worth to move to
22+
// dde-shell instead.
23+
#define _DDE_TRAY_LOADER_HANDLE_XEMBED_SELECTION_MANAGER 0
24+
1925
class FdoSelectionManager;
2026
namespace tray {
2127
class XembedProtocol : public AbstractTrayProtocol, public QAbstractNativeEventFilter

0 commit comments

Comments
 (0)