diff --git a/debian/control b/debian/control index 80383de34..74dc0a1c4 100644 --- a/debian/control +++ b/debian/control @@ -82,7 +82,7 @@ Depends: qml6-module-qtquick-layouts, qml6-module-qtquick-window, qt6-wayland (>= 6.8), - dde-application-manager (>> 1.2.51), + dde-application-manager (>> 1.2.54), ${misc:Depends}, ${shlibs:Depends}, Breaks: diff --git a/panels/dock/dockpanel.cpp b/panels/dock/dockpanel.cpp index 0a47b765f..15754ac12 100644 --- a/panels/dock/dockpanel.cpp +++ b/panels/dock/dockpanel.cpp @@ -17,12 +17,14 @@ #include "dockdaemonadaptor.h" #include "loadtrayplugins.h" -#include -#include -#include +#include #include +#include +#include #include -#include +#include + +#include #ifdef HAVE_DDE_API_EVENTLOGGER #include @@ -356,15 +358,23 @@ bool DockPanel::debugMode() const #endif } -void DockPanel::openDockSettings() const +void DockPanel::openDockSettings() { - DDBusSender() - .service(QStringLiteral("org.deepin.dde.ControlCenter1")) - .path(QStringLiteral("/org/deepin/dde/ControlCenter1")) - .interface(QStringLiteral("org.deepin.dde.ControlCenter1")) - .method(QStringLiteral("ShowPage")) - .arg(QStringLiteral("personalization/dock")) - .call(); + qCDebug(dockLog) << "openDockSettings"; + auto *activation = new ds::XdgActivation(this); + connect(activation, &ds::XdgActivation::tokenReady, this, [activation](const QString &token) { + QStringList args = {"--by-user", "org.deepin.dde.control-center"}; + if (!token.isEmpty()) { + qCDebug(dockLog) << "Passing XDG_ACTIVATION_TOKEN to dde-am"; + args << "-e" << QStringLiteral("XDG_ACTIVATION_TOKEN=") + token; + } + args << "--" + << "-p" + << "personalization/dock"; + QProcess::startDetached("dde-am", args); + activation->deleteLater(); + }); + activation->requestToken(); } void DockPanel::notifyDockPositionChanged(int offsetX, int offsetY) diff --git a/panels/dock/dockpanel.h b/panels/dock/dockpanel.h index 8fcc14fd6..e6106f117 100644 --- a/panels/dock/dockpanel.h +++ b/panels/dock/dockpanel.h @@ -80,7 +80,7 @@ class DockPanel : public DS_NAMESPACE::DPanel, public QDBusContext bool debugMode() const; - Q_INVOKABLE void openDockSettings() const; + Q_INVOKABLE void openDockSettings(); Q_INVOKABLE void notifyDockPositionChanged(int offsetX, int offsetY); diff --git a/panels/dock/tray/quickpanel/CMakeLists.txt b/panels/dock/tray/quickpanel/CMakeLists.txt index ef2440601..38b7a773e 100644 --- a/panels/dock/tray/quickpanel/CMakeLists.txt +++ b/panels/dock/tray/quickpanel/CMakeLists.txt @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +# SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: GPL-3.0-or-later @@ -24,6 +24,8 @@ qt_add_qml_module(tray-quickpanel target_link_libraries(tray-quickpanel PRIVATE Dtk${DTK_VERSION_MAJOR}::Core + Qt${QT_VERSION_MAJOR}::Gui + dde-shell-frame ) install(TARGETS tray-quickpanel DESTINATION "${QML_INSTALL_DIR}/org/deepin/ds/dock/tray/quickpanel/") diff --git a/panels/dock/tray/quickpanel/quickpanelproxymodel.cpp b/panels/dock/tray/quickpanel/quickpanelproxymodel.cpp index 89d479f9e..4ad8ef62b 100644 --- a/panels/dock/tray/quickpanel/quickpanelproxymodel.cpp +++ b/panels/dock/tray/quickpanel/quickpanelproxymodel.cpp @@ -1,14 +1,19 @@ -// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "quickpanelproxymodel.h" -#include #include -#include +#include +#include +#include + +#include DCORE_USE_NAMESPACE +Q_LOGGING_CATEGORY(quickpanelLog, "org.deepin.dde.shell.dock.quickpanel") + namespace dock { namespace { enum { @@ -46,12 +51,18 @@ bool QuickPanelProxyModel::isQuickPanelPopup(const QString &pluginId, const QStr void QuickPanelProxyModel::openSystemSettings() { - DDBusSender() - .service("org.deepin.dde.ControlCenter1") - .interface("org.deepin.dde.ControlCenter1") - .path("/org/deepin/dde/ControlCenter1") - .method(QString("Show")) - .call(); + qCDebug(quickpanelLog) << "openSystemSettings"; + auto *activation = new ds::XdgActivation(this); + connect(activation, &ds::XdgActivation::tokenReady, this, [activation](const QString &token) { + QStringList args = {"--by-user", "org.deepin.dde.control-center"}; + if (!token.isEmpty()) { + qCDebug(quickpanelLog) << "Passing XDG_ACTIVATION_TOKEN to dde-am"; + args << "-e" << QStringLiteral("XDG_ACTIVATION_TOKEN=") + token; + } + QProcess::startDetached("dde-am", args); + activation->deleteLater(); + }); + activation->requestToken(); } QVariant QuickPanelProxyModel::data(const QModelIndex &index, int role) const diff --git a/panels/notification/center/notifyaccessor.cpp b/panels/notification/center/notifyaccessor.cpp index ca763d374..c15f84417 100644 --- a/panels/notification/center/notifyaccessor.cpp +++ b/panels/notification/center/notifyaccessor.cpp @@ -7,14 +7,12 @@ #include #include #include -#include -#include #include -#include #include #include "dataaccessor.h" +#include DCORE_USE_NAMESPACE @@ -210,21 +208,21 @@ bool NotifyAccessor::applicationPin(const QString &appId) const void NotifyAccessor::openNotificationSetting() { - qDebug(notifyLog) << "Open notification setting"; - QDBusMessage msg = QDBusMessage::createMethodCall("org.deepin.dde.ControlCenter1", - "/org/deepin/dde/ControlCenter1", - "org.deepin.dde.ControlCenter1", - "ShowPage"); - msg << "notification"; - QDBusPendingCall call = QDBusConnection::sessionBus().asyncCall(msg); - QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this); - connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](QDBusPendingCallWatcher *self) { - QDBusReply reply = *self; - if (!reply.isValid()) { - qWarning(notifyLog) << "Failed to open notification setting:" << reply.error().message(); + qDebug(notifyLog) << "openNotificationSetting"; + auto *activation = new ds::XdgActivation(this); + connect(activation, &ds::XdgActivation::tokenReady, this, [activation](const QString &token) { + QStringList args = {"--by-user", "org.deepin.dde.control-center"}; + if (!token.isEmpty()) { + qDebug(notifyLog) << "Passing XDG_ACTIVATION_TOKEN to dde-am"; + args << "-e" << QStringLiteral("XDG_ACTIVATION_TOKEN=") + token; } - self->deleteLater(); + args << "--" + << "-p" + << "notification"; + QProcess::startDetached("dde-am", args); + activation->deleteLater(); }); + activation->requestToken(); } void NotifyAccessor::onNotificationStateChanged(qint64 id, int processedType)