Skip to content
Open
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 @@ -5,7 +5,7 @@ Maintainer: Deepin Packages Builder <packages@deepin.com>
Build-Depends:
debhelper-compat (= 13),
cmake,
dde-application-manager-api (>> 1.2.51),
dde-application-manager-api (>= 1.2.48),
dde-api-dev (>> 6.0.39),
dde-tray-loader-dev (> 2.0.24),
extra-cmake-modules,
Expand Down Expand Up @@ -82,6 +82,7 @@ Depends:
qml6-module-qtquick-layouts,
qml6-module-qtquick-window,
qt6-wayland (>= 6.8),
dde-application-manager (>> 1.2.51),
${misc:Depends},
${shlibs:Depends},
Breaks:
Expand Down
20 changes: 18 additions & 2 deletions panels/dock/dockdbusproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ DockDBusProxy::DockDBusProxy(DockPanel* parent)
timer->stop();
timer->deleteLater();
connect(m_trayApplet, SIGNAL(pluginsChanged()), this, SIGNAL(pluginsChanged()));
QTimer::singleShot(3000, this, [this]() {
logInitialPluginState();
// Trigger a debounced log on each change, and also schedule one immediately after first load
connect(this, &DockDBusProxy::pluginsChanged, this, [this]() {
scheduleDebouncedLog();
});
scheduleDebouncedLog();
}
});
timer->start();
Expand Down Expand Up @@ -301,6 +303,20 @@ void DockDBusProxy::logCurrentVisiblePluginList(const QString &changedItemKey, b
#endif
}

// Restart the timer on every pluginsChanged; only log after the list stays stable for 2s
void DockDBusProxy::scheduleDebouncedLog()
{
if (!m_debounceTimer) {
m_debounceTimer = new QTimer(this);
m_debounceTimer->setSingleShot(true);
m_debounceTimer->setInterval(2000);
connect(m_debounceTimer, &QTimer::timeout, this, [this]() {
logInitialPluginState();
});
}
m_debounceTimer->start();
}

void DockDBusProxy::ReloadPlugins()
{
parent()->ReloadPlugins();
Expand Down
4 changes: 4 additions & 0 deletions panels/dock/dockdbusproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ class DockDBusProxy final: public QObject, public QDBusContext
void updateDockPluginsVisible(const QVariantMap &pluginsVisible);
void logInitialPluginState();
void logCurrentVisiblePluginList(const QString &changedItemKey = QString(), bool changedVisible = true);
// Debounce logging the initial plugin list, as it may change asynchronously right after load
void scheduleDebouncedLog();

DS_NAMESPACE::DAppletProxy *m_oldDockApplet;
DS_NAMESPACE::DAppletProxy *m_trayApplet;
// Debounce timer to ensure the plugin list has stabilized before logging
QTimer *m_debounceTimer = nullptr;
};
}
Loading