Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ Description: DDE Shell dock library
Package: dde-shell
Architecture: any
Depends:
dde-tray-loader (>= 1.99.8),
dde-session (>= 2.0.33),
dde-tray-loader (>= 2.0.41),
libdde-shell (= ${binary:Version}),
libdde-shell-dock (= ${binary:Version}),
libdtk6declarative,
Expand Down
2 changes: 0 additions & 2 deletions panels/dock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ file(
dockhelper.cpp
waylanddockhelper.h
waylanddockhelper.cpp
loadtrayplugins.h
loadtrayplugins.cpp
)

# Old dbus interface compatible
Expand Down
32 changes: 0 additions & 32 deletions panels/dock/dconfig/org.deepin.ds.dock.tray.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,38 +88,6 @@
"description[zh_CN]": "托盘折叠区域当前的状态",
"permissions": "readwrite",
"visibility": "private"
},
"selfMaintenanceTrayPlugins": {
"value": ["libapplication-tray.so", "libbrightness.so", "libdatetime.so", "libdnd-mode.so", "libeye-comfort-mode.so", "libmedia.so", "libnotification.so", "libonboard.so", "libshutdown.so", "libairplane-mode.so", "libbluetooth.so", "libdock-network-plugin.so", "libdock-wirelesscasting-plugin.so", "libkeyboard-layout.so", "libpower.so", "libsound.so"],
"serial": 0,
"flags": [],
"name": "self maintenance plugins",
"name[zh_CN]": "自维护托盘插件",
"description": "self maintenance plugins",
"description[zh_CN]": "自维护托盘插件",
"permissions": "readonly",
"visibility": "private"
},
"subprojectTrayPlugins": {
"value": ["libdock-clipboard-plugin.so", "libddegrandsearch_dockplugin.so", "libdeepin-screen-recorder-plugin.so", "libdeepin-system-monitor-plugin.so", "libshot-start-plugin.so", "libshot-start-record-plugin.so", "libdde-disk-mount-plugin.so"],
"serial": 0,
"flags": [],
"name": "subproject tray plugins",
"name[zh_CN]": "子项目托盘插件",
"description": "subproject tray plugins",
"description[zh_CN]": "子项目托盘插件",
"permissions": "readwrite",
"visibility": "private"
},
"crashProneTrayPlugins": {
"value": [],
"serial": 0,
"flags": [],
"name": "crash-prone tray plugins",
"name[zh_CN]": "易于崩溃的托盘插件",
"description": "crash-prone tray plugins",
"description[zh_CN]": "易于崩溃的托盘插件",
"permissions": "readwrite"
}
}
}
16 changes: 12 additions & 4 deletions panels/dock/dockpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@

// for old api compatible
#include "dockdbusproxy.h"
#include "dockfrontadaptor.h"

Check warning on line 16 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "dockfrontadaptor.h" not found.
#include "dockdaemonadaptor.h"

Check warning on line 17 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "dockdaemonadaptor.h" not found.
#include "loadtrayplugins.h"

#include <DGuiApplicationHelper>

Check warning on line 19 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DGuiApplicationHelper> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QGuiApplication>

Check warning on line 20 in panels/dock/dockpanel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QGuiApplication> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QLoggingCategory>
#include <QProcess>
#include <QQuickItem>
Expand All @@ -41,15 +40,21 @@
, m_theme(ColorTheme::Dark)
, m_hideState(Show)
, m_dockScreen(nullptr)
, m_loadTrayPlugins(new LoadTrayPlugins(this))
, m_compositorReady(false)
, m_launcherShown(false)
, m_contextDragging(false)
, m_isResizing(false)
{
// The org.deepin.dde.Dock1 service name is used as the readiness flag of the
// Type=dbus systemd unit (dde-shell@DDE.service). It must only be acquired
// after the QML DockCompositor is created, so that tray plugin loader
// services ordered After=dde-shell@DDE.service can rely on it being safe
// to connect to the dockplugin Wayland socket.
connect(this, &DockPanel::compositorReadyChanged, this, [this] {
if (!m_compositorReady) return;
m_loadTrayPlugins->loadDockPlugins();
if (!QDBusConnection::sessionBus().registerService("org.deepin.dde.Dock1")) {
qCWarning(dockLog) << "Failed to register org.deepin.dde.Dock1 after compositor ready";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): If registering org.deepin.dde.Dock1 fails after the compositor becomes ready, the code only logs a warning and never retries or reports startup failure. The Type=dbus unit therefore never reaches its active state, so tray-loader services ordered after it do not start.

Triggers: When the session bus registration temporarily fails or the bus name is already owned.

Suggested fix: Retry registration until it succeeds, or terminate/escalate the startup failure so systemd can restart the dock.

Suggested change
qCWarning(dockLog) << "Failed to register org.deepin.dde.Dock1 after compositor ready";
qFatal("Failed to register org.deepin.dde.Dock1 after compositor ready");

}
});
}

Expand Down Expand Up @@ -83,7 +88,10 @@
DockDBusProxy* proxy = new DockDBusProxy(this);
DockFrontAdaptor* dockFrontAdaptor = new DockFrontAdaptor(proxy);
Q_UNUSED(dockFrontAdaptor)
QDBusConnection::sessionBus().registerService("org.deepin.dde.Dock1");
// NOTE: the object is exported here, but the org.deepin.dde.Dock1 service
// name is only acquired once the compositor is ready, see the constructor.
// It is the BusName of the Type=dbus unit dde-shell@DDE.service and thus
// defines when systemd considers the dock started.
QDBusConnection::sessionBus().registerObject("/org/deepin/dde/Dock1", "org.deepin.dde.Dock1", proxy);

DockDaemonAdaptor* dockDaemonAdaptor = new DockDaemonAdaptor(proxy);
Expand Down
2 changes: 0 additions & 2 deletions panels/dock/dockpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace dock {
class DockHelper;
class LoadTrayPlugins;

class DockPanel : public DS_NAMESPACE::DPanel, public QDBusContext
{
Expand Down Expand Up @@ -167,7 +166,6 @@ private Q_SLOTS:
HideState m_hideState;
DockHelper* m_helper;
QPointer<QScreen> m_dockScreen;
LoadTrayPlugins *m_loadTrayPlugins;
bool m_compositorReady;
bool m_launcherShown;
bool m_contextDragging;
Expand Down
199 changes: 0 additions & 199 deletions panels/dock/loadtrayplugins.cpp

This file was deleted.

47 changes: 0 additions & 47 deletions panels/dock/loadtrayplugins.h

This file was deleted.

Loading
Loading