Bug 506236 - App notifications that use a plasma_workspace event open in System Notifications mode
Summary: App notifications that use a plasma_workspace event open in System Notificati...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_notify (other bugs)
Version First Reported In: 6.4.80
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-26 19:27 UTC by Ritchie Frodomar
Modified: 2025-08-15 11:44 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.4.5
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ritchie Frodomar 2025-06-26 19:27:17 UTC
SUMMARY
Spotify shows a visible notification every time a new song plays. I find these distracting and want to block them from within Plasma. Clicking the settings icon on one of them yields a blank notification settings window. This doesn't happen for notifications from other apps, like from Discord or NeoChat.

STEPS TO REPRODUCE
1. Install and use Spotify
2. Play a song
3. When the "Now playing" notification appears, click the configure icon in the corner of it

OBSERVED RESULT
The notification settings window will be blank, your only option is to go back.

EXPECTED RESULT
You should see the normal notification settings, and be able to block the notification if you'd like.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Plasma 6.4.0 on Fedora Linux 42
KDE Plasma Version: 6.4.0
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1

ADDITIONAL INFORMATION
These notifications are distracting to me because, for some reason, they grab partial window focus. Trying to close a window with Alt+F4 while one of them is visible, will close Spotify, stopping my music. Trying to use Alt+Tab to switch to a window I was previously using after one of these notifications pop up causes Spotify to appear, getting in my way. These are likely their own bugs though.
Comment 1 Ismael Asensio 2025-06-26 21:16:09 UTC
I can confirm that clicking on the notification goes to its settings page, but this page is broken, as it doesn't show the header where you can disable the notifications for this app.

But if you go back (or open the Notifications KCM directly), and then Applications > Spotify, the page shows correctly (at least for me) and one can disable them.

Checking a bit around, I see this issue happens also with other apps, even KDE ones, like Spectacle, but not with a "Low Battery" one from KDE Connect. Summarizing, if the notification belongs to a registered event, this event is selected and the page is shown correctly. If the notification doesn't belong to a registered event, the KCM moves to the page, but it is a bit broken when it shows.

I remember this mechanism being a bit brittle, will take a look soon
Comment 2 Ismael Asensio 2025-06-27 18:03:21 UTC
Got a hint of what's going on.

Apps that don't have a custom .notifyrc config file (such as 3rd party apps using the notification service) actually use a plasma_workspace event. When pressing "configure" over such notification, the kcm receives this as an argument, and gets misleaded: It tries to configure the app from the desktop entry (ex. Spotify), but it opens in "system notifications" mode with no events to configure.

For a Spotify notification, the KCM is receiving these arguments:
kcm_notifications --desktop-entry com.spotify.Client --notifyrc plasma_workspace --event-id notification

Or when clearing the trash in dolphin:
kcm_notifications --desktop-entry org.kde.dolphin --notifyrc plasma_workspace --event-id 'Trash: emptied'

Not sure yet where to try and fix this issue. In the first case we'd want to open the notification settings for "Spotify", but on the second one I think it's better to actually open the system notifications for the trash event. But we're mixing both and failing to show the right configuration in both cases.
Comment 3 Bug Janitor Service 2025-06-27 19:05:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5635
Comment 4 Ismael Asensio 2025-07-11 17:02:14 UTC
Git commit e9f76423f46b743ebeae9b90ef4cd937d0258f66 by Ismael Asensio.
Committed on 11/07/2025 at 16:32.
Pushed by iasensio into branch 'master'.

kcms/notifications: Do not show System Notifications page for apps

For sandboxed apps, which use the notifications portal, the origin
(notifyrc file) is actually `plasma_workspace` with an event-id
of type `notification`.

Check for this to avoid showing the System Notifications when we
actually want to configure the notifications for the app
FIXED-IN: 6.4.2

M  +2    -1    kcms/notifications/ui/main.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/e9f76423f46b743ebeae9b90ef4cd937d0258f66
Comment 5 Ismael Asensio 2025-07-11 17:02:22 UTC
Git commit 62f4c616c0a848b6f052f209a10f22ddba46f79c by Ismael Asensio.
Committed on 11/07/2025 at 16:32.
Pushed by iasensio into branch 'master'.

kcms/notifications: Fix broken "configure notification" page

When clicking the configure button on a notification, we launch the
KCM with the notification info so it directly navigates to the
specific app/service and event.

When the notification event belongs to plasma-workspace we try to
show the System Notifications index, but if there is also a desktop
entry, the page will override this index to the application's one,
showing a "broken" page.

Fix this by setting all the desired properties on the call that
opens the Sources Settings page, instead of calculating it after
the page is loaded.

M  +3    -14   kcms/notifications/ui/SourcesPage.qml
M  +20   -6    kcms/notifications/ui/main.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/62f4c616c0a848b6f052f209a10f22ddba46f79c
Comment 6 Ismael Asensio 2025-08-15 11:44:40 UTC
Git commit 1b7f02d2273c70904e65892f53b67e79c27f34e2 by Ismael Asensio.
Committed on 15/08/2025 at 11:05.
Pushed by iasensio into branch 'Plasma/6.4'.

kcms/notifications: Do not show System Notifications page for apps

For sandboxed apps, which use the notifications portal, the origin
(notifyrc file) is actually `plasma_workspace` with an event-id
of type `notification`.

Check for this to avoid showing the System Notifications when we
actually want to configure the notifications for the app
FIXED-IN: 6.4.5

(cherry picked from commit e9f76423f46b743ebeae9b90ef4cd937d0258f66)

M  +2    -1    kcms/notifications/ui/main.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/1b7f02d2273c70904e65892f53b67e79c27f34e2
Comment 7 Ismael Asensio 2025-08-15 11:44:48 UTC
Git commit d75d2efec3311619677f8a42d2da2dafcb15600e by Ismael Asensio.
Committed on 15/08/2025 at 11:05.
Pushed by iasensio into branch 'Plasma/6.4'.

kcms/notifications: Fix broken "configure notification" page

When clicking the configure button on a notification, we launch the
KCM with the notification info so it directly navigates to the
specific app/service and event.

When the notification event belongs to plasma-workspace we try to
show the System Notifications index, but if there is also a desktop
entry, the page will override this index to the application's one,
showing a "broken" page.

Fix this by setting all the desired properties on the call that
opens the Sources Settings page, instead of calculating it after
the page is loaded.
(cherry picked from commit 62f4c616c0a848b6f052f209a10f22ddba46f79c)

M  +3    -14   kcms/notifications/ui/SourcesPage.qml
M  +20   -6    kcms/notifications/ui/main.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/d75d2efec3311619677f8a42d2da2dafcb15600e