From 1959e90632fc74df997e2adfc60c2e23e59fcb10 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Mon, 25 Oct 2021 13:40:02 +0200 Subject: [PATCH] Fix : keep fullscreen mode on timeout notification. - Come back to fullscreen when clicking on fullscreen icon in call. --- linphone-app/src/components/notifier/Notifier.cpp | 12 +++++++++++- linphone-app/src/components/notifier/Notifier.hpp | 1 + linphone-app/ui/views/App/Calls/Incall.js | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/linphone-app/src/components/notifier/Notifier.cpp b/linphone-app/src/components/notifier/Notifier.cpp index 0a726c80b..89fab2433 100644 --- a/linphone-app/src/components/notifier/Notifier.cpp +++ b/linphone-app/src/components/notifier/Notifier.cpp @@ -212,7 +212,7 @@ void Notifier::showNotification (QObject *notification, int timeout) { // Destroy it after timeout. QObject::connect(timer, &QTimer::timeout, this, [this, notification]() { - deleteNotification(QVariant::fromValue(notification)); + deleteNotificationOnTimeout(QVariant::fromValue(notification)); }); // Called explicitly (by a click on notification for example) @@ -222,6 +222,16 @@ void Notifier::showNotification (QObject *notification, int timeout) { } // ----------------------------------------------------------------------------- +void Notifier::deleteNotificationOnTimeout(QVariant notification) { +#ifdef Q_OS_MACOS + for(auto w : QGuiApplication::topLevelWindows()){ + if( (w->windowState()&Qt::WindowFullScreen)==Qt::WindowFullScreen){ + w->requestActivate();// Used to get focus on fullscreens on Mac in order to avoid screen switching. + } + } +#endif + deleteNotification(notification); +} void Notifier::deleteNotification (QVariant notification) { mMutex->lock(); diff --git a/linphone-app/src/components/notifier/Notifier.hpp b/linphone-app/src/components/notifier/Notifier.hpp index 79b88209f..9e508617f 100644 --- a/linphone-app/src/components/notifier/Notifier.hpp +++ b/linphone-app/src/components/notifier/Notifier.hpp @@ -60,6 +60,7 @@ public: void notifyRecordingCompleted (const QString &filePath); public slots: + void deleteNotificationOnTimeout(QVariant notification); void deleteNotification (QVariant notification); private: diff --git a/linphone-app/ui/views/App/Calls/Incall.js b/linphone-app/ui/views/App/Calls/Incall.js index 7c635801e..531b61c1e 100644 --- a/linphone-app/ui/views/App/Calls/Incall.js +++ b/linphone-app/ui/views/App/Calls/Incall.js @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2010-2020 Belledonne Communications SARL. * * This file is part of linphone-desktop @@ -132,6 +132,7 @@ function openMediaParameters (window, incall) { function showFullscreen (position) { if (incall._fullscreen) { + incall._fullscreen.raise() return } DesktopTools.DesktopTools.screenSaverStatus = false