From ccd5a806e2096af75fbed312f9e4d8791bdac97d Mon Sep 17 00:00:00 2001 From: data Date: Fri, 6 Feb 2026 18:08:28 +0100 Subject: [PATCH] fix: show notification only on primary screen Prevents multiple notification windows from appearing (one per screen) when receiving an incoming call. Now only shows on the primary display. Co-Authored-By: Claude Opus 4.5 --- Linphone/core/notifier/Notifier.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Linphone/core/notifier/Notifier.cpp b/Linphone/core/notifier/Notifier.cpp index 58c3289f..8c74e847 100644 --- a/Linphone/core/notifier/Notifier.cpp +++ b/Linphone/core/notifier/Notifier.cpp @@ -135,8 +135,8 @@ bool Notifier::createNotification(Notifier::NotificationType type, QVariantMap d mMutex->unlock(); return false; } - QList allScreens = QGuiApplication::screens(); - if (allScreens.size() > 0) { // Ensure to have a screen to avoid errors + QScreen *primaryScreen = QGuiApplication::primaryScreen(); + if (primaryScreen) { // Ensure to have a screen to avoid errors QQuickItem *previousWrapper = nullptr; bool showAsTool = false; #ifdef Q_OS_MACOS @@ -149,12 +149,12 @@ bool Notifier::createNotification(Notifier::NotificationType type, QVariantMap d } } #endif - for (int i = 0; i < allScreens.size(); ++i) { - + // Only show notification on primary screen (not on all screens) + { ++mInstancesNumber; // Use QQuickView to create a visual root object that is // independant from current application Window - QScreen *screen = allScreens[i]; + QScreen *screen = primaryScreen; auto engine = App::getInstance()->mEngine; const QUrl url(QString(NotificationsPath) + Notifier::Notifications[type].filename); QObject::connect(