From e8a473a375d5fc290d35c6e5128ea63972ecbaf8 Mon Sep 17 00:00:00 2001 From: Mengci Cai Date: Wed, 4 Feb 2026 14:52:26 +0800 Subject: [PATCH 1/2] fix: delay deepin-screen-recorder notify 1. Added QTimer include for asynchronous delay handling 2. Modified Notify method to check for "deepin-screen-recorder" appIcon 3. Implemented 3-second delay using QTimer::singleShot for screen recorder notifications 4. Ensured parameters are captured by value for the delayed execution This change prevents the screen recorder notification from appearing too early, which may interfere with the recording start or UI behavior. Log: Delayed the display time of screen recorder notifications to improve user experience. Influence: 1. Test notification triggering from deepin-screen-recorder and verify the 3-second delay 2. Test notifications from other applications to ensure they appear immediately without delay 3. Verify that mixed notifications (screen recorder and others) are processed correctly 4. Check for potential memory leaks or crashes when notifications are delayed 5. Verify the return value handling for delayed notifications pms: BUG-338965/BUG-336159 --- panels/notification/server/dbusadaptor.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/panels/notification/server/dbusadaptor.cpp b/panels/notification/server/dbusadaptor.cpp index 61438fdab..b0206baca 100644 --- a/panels/notification/server/dbusadaptor.cpp +++ b/panels/notification/server/dbusadaptor.cpp @@ -8,6 +8,7 @@ #include #include #include +#include namespace notification { Q_DECLARE_LOGGING_CATEGORY(notifyLog) @@ -30,6 +31,20 @@ uint DbusAdaptor::Notify(const QString &appName, uint replacesId, const QString const QString &body, const QStringList &actions, const QVariantMap &hints, int expireTimeout) { + // Delay processing for 3 seconds when appIcon == "deepin-screen-recorder" + if (appIcon == "deepin-screen-recorder") { + // Use QTimer to delay processing asynchronously without blocking other notifications + QTimer::singleShot(3000, this, [this, appName, replacesId, appIcon, summary, body, actions, hints, expireTimeout]() { + uint id = manager()->Notify(appName, replacesId, appIcon, summary, body, actions, hints, expireTimeout); + if (id == 0) { + QDBusError error(QDBusError::InternalError, "Notify failed."); + QDBusMessage reply = QDBusMessage::createError(error); + QDBusConnection::sessionBus().send(reply); + } + }); + return 1; + } + uint id = manager()->Notify(appName, replacesId, appIcon, summary, body, actions, hints, expireTimeout); if (id == 0) { QDBusError error(QDBusError::InternalError, "Notify failed."); From c1fec062091f1939eda0e500dea6dc850a528853 Mon Sep 17 00:00:00 2001 From: Mengci Cai Date: Wed, 4 Feb 2026 16:58:07 +0800 Subject: [PATCH 2/2] fix: return mute icon for silent audio Updated the logic in the AudioApplet to correctly identify and display the mute icon when the volume level is less than or equal to 1. Previously, the code failed to explicitly handle the state where volume was 0 or very low, potentially resulting in incorrect icon rendering or undefined behavior. The change adds an else block to return "osd_volume_mute" in these cases, ensuring accurate UI feedback for users. Log: Fixed the audio OSD mute icon display for silent state Influence: 1. Test volume at 0% to ensure the mute icon is displayed 2. Test volume between 1% and 66% to ensure the low/mid volume icon is displayed 3. Test volume above 66% to ensure the high volume icon is displayed 4. Verify icon switching behavior when sliding the volume slider pms: BUG-349767 --- panels/notification/osd/audio/audioapplet.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/panels/notification/osd/audio/audioapplet.cpp b/panels/notification/osd/audio/audioapplet.cpp index 81acf6d77..f09371fde 100644 --- a/panels/notification/osd/audio/audioapplet.cpp +++ b/panels/notification/osd/audio/audioapplet.cpp @@ -84,6 +84,8 @@ QString AudioApplet::fetchIconName() const level = "100"; else if (volume > 1) level = "more"; + else + return "osd_volume_mute"; return QString("osd_volume_%1").arg(level); }