You are not logged in.

#1 2026-10-24 15:59:09

jmj
Member
Registered: 2023-12-10
Posts: 17

[SOLVED] Mumble notifications only appear once in KDE Plasma

I'm testing Mumble in Plasma and I noticed that the notifications only happen once until I restart Mumble.

To test, I have a global hotkey set in Mumble for Mute Self, and the notification option enabled for "You self-muted." I open mumble, minimize, then hit the global hotkey. I see "You self-muted" pop up. I then wait for it to close after it times out (currently set to 2 seconds), and hit the hotkey again. No notification.

After some testing I noticed that if I click X in the notification to close it, the next notification will work. The blockage only happens when I let it disappear by itself. It also works if I enable notification history under "Other Applications" in System Settings -> Notifications, then open the history and click the X to dismiss it. Though I don't want to have to manually dismiss the notification for subsequent ones to appear.

I guess it's some quirk with how notifications work between Plasma and Mumble because it works fine in XFCE.

Last edited by jmj (2026-10-26 17:29:43)

Offline

#2 2026-10-26 17:29:30

jmj
Member
Registered: 2023-12-10
Posts: 17

Re: [SOLVED] Mumble notifications only appear once in KDE Plasma

Alright so with the help of a certain chatbot I now understand the problem and have a fix. The problem was Mumble was always reusing the same "replaces_id" when it should be using zero if the notification times out. The fix implements a function for NotificationClosed messages where it sets uiLastId to 0. This allows for new notifications while allowing the same notification pop up to be reused if a new message happens within the timeout window.

diff --git a/src/mumble/Log.cpp b/src/mumble/Log.cpp
index 7ba7e0f..81e5902 100644
--- a/src/mumble/Log.cpp
+++ b/src/mumble/Log.cpp
@@ -27,6 +27,7 @@
 
 #include <QSignalBlocker>
 #include <QtCore/QMutexLocker>
+#include <QtDBus/QDBusConnection>
 #include <QtGui/QImageWriter>
 #include <QtGui/QScreen>
 #include <QtGui/QTextBlock>
@@ -424,6 +425,14 @@ Log::Log(QObject *p) : QObject(p) {
 #endif
 	uiLastId = 0;
 	qdDate   = QDate::currentDate();
+
+	const bool connected = QDBusConnection::sessionBus().connect(
+		QStringLiteral("org.freedesktop.Notifications"),
+		QStringLiteral("/org/freedesktop/Notifications"),
+		QStringLiteral("org.freedesktop.Notifications"),
+		QStringLiteral("NotificationClosed"),
+		this,
+		SLOT(notificationClosed(uint,uint)));
 }
 
 // Display order in settingsscreen, allows to insert new events without breaking config-compatibility with older
diff --git a/src/mumble/Log.h b/src/mumble/Log.h
index 3757510..56d6a41 100644
--- a/src/mumble/Log.h
+++ b/src/mumble/Log.h
@@ -158,6 +158,7 @@ public slots:
 			 const QString &overrideTTS = QString(), bool ignoreTTS = false);
 	/// Logs LogMessages that have been deferred so far
 	void processDeferredLogs();
+	void notificationClosed(uint id, uint reason);
 };
 
 class LogMessage {
diff --git a/src/mumble/Log_unix.cpp b/src/mumble/Log_unix.cpp
index 8e775ff..7dad6bf 100644
--- a/src/mumble/Log_unix.cpp
+++ b/src/mumble/Log_unix.cpp
@@ -9,6 +9,13 @@
 
 #include <QDBusInterface>
 
+void Log::notificationClosed(uint id, uint reason) {
+	Q_UNUSED(reason);
+
+	if (id == uiLastId)
+		uiLastId = 0;
+}
+
 void Log::postNotification(MsgType mt, const QString &plain) {
 	// Message notification with balloon tooltips
 	QString qsIcon;

Offline

Board footer

Powered by FluxBB