From 5b6e313f425d44cd3be3acd6d2f63a725ce3a55f Mon Sep 17 00:00:00 2001 From: chenyuanbo Date: Wed, 6 May 2026 14:47:20 +0800 Subject: [PATCH] fix: display banner notification after changing scale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After clicking the 'Later' button to turn off the scale notification, reset the replaceId of the notification so that the scale notification can be triggered when the scale is changed again 点击“稍后注销”按钮关闭缩放通知后,重置对应通知的replaceId,使得再次更改缩放后可以触发通知 Log: 点击“稍后注销”按钮关闭缩放通知后,重置对应通知的replaceId PMS: BUG-358697 Influence: 缩放通知关闭后,再次更改缩放后可以触发通知 --- src/service/dbus/appearancedbusproxy.cpp | 11 ++++++++++- src/service/dbus/appearancedbusproxy.h | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/service/dbus/appearancedbusproxy.cpp b/src/service/dbus/appearancedbusproxy.cpp index 3a66f18..4558b5a 100644 --- a/src/service/dbus/appearancedbusproxy.cpp +++ b/src/service/dbus/appearancedbusproxy.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -32,6 +32,7 @@ AppearanceDBusProxy::AppearanceDBusProxy(QObject *parent) QDBusConnection::sessionBus().connect("org.deepin.dde.XSettings1","/org/deepin/dde/XSettings1","org.deepin.dde.XSettings1","SetScaleFactorDone",this,SIGNAL(SetScaleFactorDone())); QDBusConnection::sessionBus().connect("org.deepin.dde.Display1", "/org/deepin/dde/Display1", "org.freedesktop.DBus.Properties","PropertiesChanged", this, SLOT(onDisplayPropertiesChanged(QDBusMessage))); + QDBusConnection::sessionBus().connect("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications", "NotificationClosed", this, SLOT(onNotificationClosed(uint, uint))); } void AppearanceDBusProxy::setUserInterface(const QString &userPath) @@ -294,3 +295,11 @@ void AppearanceDBusProxy::onDisplayPropertiesChanged(const QDBusMessage &message } } } + +void AppearanceDBusProxy::onNotificationClosed(uint id, uint reason) +{ + Q_UNUSED(reason) + // reset m_nid after notification closure + if (id == m_nid) + m_nid = 0; +} diff --git a/src/service/dbus/appearancedbusproxy.h b/src/service/dbus/appearancedbusproxy.h index f98ce84..351cd92 100644 --- a/src/service/dbus/appearancedbusproxy.h +++ b/src/service/dbus/appearancedbusproxy.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -130,6 +130,7 @@ public Q_SLOTS: private Q_SLOTS: void onDisplayPropertiesChanged(const QDBusMessage &message); + void onNotificationClosed(uint, uint); private: DDBusInterface *m_wmInterface;