Bug 457672

Summary: Spotify notifications (coming from plasma-workspace, through XDG portal) plays error sound
Product: [Plasma] xdg-desktop-portal-kde Reporter: Linus Kardell <linus.kardell>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: agurenko, aleixpol, angusfk, bizyaev, eric.donkersloot, fedin-ilja2010, fella, jgrulich, katyaberezyaka, kdebugs.81do7, kdelibs-bugs, lukas, michele.kipiel, nanoblade9, nate, progexer, spry.bed7373, zellox
Priority: NOR    
Version: 5.26.3   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
See Also: https://github.com/telegramdesktop/tdesktop/issues/25469
Latest Commit: Version Fixed In: 5.105
Sentry Crash Report:

Description Linus Kardell 2022-08-09 12:00:37 UTC
SUMMARY
Lately, every time you switch song in Spotify, Plasma plays the error notification sound. This happens even if you disable notifications for Spotify in the Plasma settings. The only way to get rid of it seems to be to disable desktop notifications for song changes in the Spotify app, or disable notification sounds globally.

STEPS TO REPRODUCE
1. Open Spotify
2. Switch song

OBSERVED RESULT
Error sound plays

EXPECTED RESULT
Notification shown silently

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220804
KDE Plasma Version: 5.25.3
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.5
Kernel Version: 5.18.15-1-default (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 62.7 Gibyte of RAM
Graphics Processor: NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2
Manufacturer: ASUS
Spotify: 1.1.84.716.gc5f8b819 from Flathub
Comment 2 Wyatt Childers 2022-11-28 17:58:02 UTC
I don't want to presume, but I'd consider this a duplicate of 462283 (I've posted a workaround given by a Telegram contributor there).
Comment 3 Nate Graham 2022-11-28 19:41:58 UTC
It's the opposite; the newer ones should be marked as a duplicate of this. But yes, you're right!
Comment 4 Nate Graham 2022-11-28 19:43:07 UTC
*** Bug 462357 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2022-11-28 19:43:09 UTC
*** Bug 462283 has been marked as a duplicate of this bug. ***
Comment 6 Ilya Fedin 2022-11-28 19:45:19 UTC
Wouldn't the right fix be to just remove the KNotification::DefaultEvent flag? The portal creates applications' notifications, not system notifications after all.
https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/blob/master/src/notification.cpp#L36
Comment 7 MK 2023-02-27 14:45:20 UTC
Happens to me as well, it's annoying as heck. 

Box details as follows:
Operating System: openSUSE Tumbleweed 20230226
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.12-1-default (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-6200U CPU @ 2.30GHz
Memory: 7.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 520
Manufacturer: LENOVO
Product Name: 20FB002UMS
System Version: ThinkPad X1 Carbon 4th
Comment 8 Bug Janitor Service 2023-02-27 15:31:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/169
Comment 9 Aleix Pol 2023-03-12 23:51:01 UTC
*** Bug 466441 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2023-03-29 16:05:02 UTC
Git commit 183c0525e7a33996126c9438ce2a17065a274e54 by Nate Graham, on behalf of Nicolas Fella.
Committed on 29/03/2023 at 16:04.
Pushed by ngraham into branch 'master'.

Don't play sound for plain notification

We typically don't play a sound by default for most notifications.
However the 'notification' event for the Plasma default notifyrc
has a sound by default

Since this event is used by xdg-desktop-portal-kde, currently all
notifications from Flatpak apps have a sound by default, making
them inconsistent with their non-Flatpak counterparts.

Remove the default sound to align them.
FIXED-IN: 5.105

M  +1    -2    plasma_workspace.notifyrc

https://invent.kde.org/frameworks/frameworkintegration/commit/183c0525e7a33996126c9438ce2a17065a274e54
Comment 11 Nate Graham 2023-03-29 16:07:01 UTC
Git commit f4a899b321948bfa9a0a890f2027678557944205 by Nate Graham, on behalf of Nicolas Fella.
Committed on 29/03/2023 at 16:06.
Pushed by ngraham into branch 'kf5'.

Don't play sound for plain notification

We typically don't play a sound by default for most notifications.
However the 'notification' event for the Plasma default notifyrc
has a sound by default

Since this event is used by xdg-desktop-portal-kde, currently all
notifications from Flatpak apps have a sound by default, making
them inconsistent with their non-Flatpak counterparts.

Remove the default sound to align them.
FIXED-IN: 5.105


(cherry picked from commit 183c0525e7a33996126c9438ce2a17065a274e54)

M  +1    -2    plasma_workspace.notifyrc

https://invent.kde.org/frameworks/frameworkintegration/commit/f4a899b321948bfa9a0a890f2027678557944205