From c7d4a373668cfe27f0516b5c7510126a54a4d8e7 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Wed, 25 Mar 2026 16:05:57 +0800 Subject: [PATCH] fix(notification): adjust notification sound playback timing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the sound playback to the end of Notify function, after all notification display logic has been processed. This ensures sound is played at the appropriate time in the notification flow. 将音效播放移到Notify函数末尾,在所有通知显示逻辑处理完成后。 这确保音效在通知流程的适当时机播放。 Log: 调整通知音效播放时机 PMS: BUG-354203 Influence: 调整音效播放时机到通知处理流程的最后阶段, 确保音效播放的时机更加合理。 --- panels/notification/server/notificationmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panels/notification/server/notificationmanager.cpp b/panels/notification/server/notificationmanager.cpp index ce3d16f94..a02efa10a 100644 --- a/panels/notification/server/notificationmanager.cpp +++ b/panels/notification/server/notificationmanager.cpp @@ -245,8 +245,6 @@ uint NotificationManager::Notify(const QString &appName, uint replacesId, const } const bool onDesktopShow = m_setting->appValue(appId, NotificationSetting::ShowOnDesktop).toBool(); - tryPlayNotificationSound(entity, appId, dndMode); - // new one if (replacesId == NoReplacesId) { entity.setBubbleId(++m_replacesCount); @@ -292,6 +290,8 @@ uint NotificationManager::Notify(const QString &appName, uint replacesId, const } } + tryPlayNotificationSound(entity, appId, dndMode); + qInfo(notifyLog) << "Notify done, bubbleId:" << entity.bubbleId() << ", id:" << entity.id() << ", type:" << entity.processedType(); // If replaces_id is 0, the return value is a UINT32 that represent the notification.