From 53d79ef48bada296276599784b705f62596d258c Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Fri, 25 Aug 2023 14:08:59 +0200 Subject: [PATCH] Fix null access in fullscreen. Add a FPS monitor for debug. Fix infinite loop on rendering frames : ForceRefresh when miniViewArea changes its height, on not the list view. --- CHANGELOG.md | 7 +++++++ linphone-app/src/app/App.cpp | 19 ++++++++++++++++++- linphone-app/src/app/main.cpp | 4 ++-- linphone-app/ui/views/App/Calls/Incall.qml | 16 ++++++++-------- .../views/App/Calls/IncallActiveSpeaker.qml | 16 +++++++++------- .../ui/views/App/Calls/IncallFullscreen.qml | 17 +++++++++-------- 6 files changed, 53 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b161ab30b..8105d437a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 5.1.2 - 2023-08-25 + +### Fixed +- Mac Freeze on Active Speaker. +- Apply Accessibility workaround on all systems. +- Null access on QML object while being in fullscreen. + ## 5.1.1 - 2023-08-24 ### Fixed diff --git a/linphone-app/src/app/App.cpp b/linphone-app/src/app/App.cpp index 2e98ba348..0289ce755 100644 --- a/linphone-app/src/app/App.cpp +++ b/linphone-app/src/app/App.cpp @@ -336,6 +336,7 @@ void App::processArguments(QHash args){ } static QQuickWindow *createSubWindow (QQmlApplicationEngine *engine, const char *path) { + QString qPath(path); qInfo() << QStringLiteral("Creating subwindow: `%1`.").arg(path); QQmlComponent component(engine, QUrl(path)); @@ -351,7 +352,23 @@ static QQuickWindow *createSubWindow (QQmlApplicationEngine *engine, const char QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); object->setParent(engine); - return qobject_cast(object); + + int totalDuration = 0; + int loops = 0; + QElapsedTimer timer; + timer.start(); + auto window = qobject_cast(object); + QObject::connect(window, &QQuickWindow::beforeRendering, [totalDuration, loops, timer, path]() mutable{ + totalDuration += timer.elapsed(); + ++loops; + if (totalDuration > 10*1000) { + qDebug() << path << " : " << (1000.0 * loops) / totalDuration << "fps"; + totalDuration = 0; + loops = 0; + } + timer.restart(); + }); + return window; } // ----------------------------------------------------------------------------- diff --git a/linphone-app/src/app/main.cpp b/linphone-app/src/app/main.cpp index ae70b10ed..0ccfa8389 100644 --- a/linphone-app/src/app/main.cpp +++ b/linphone-app/src/app/main.cpp @@ -37,8 +37,8 @@ FILE * gStream = NULL; #include "components/vfs/VfsUtils.hpp" #endif -#if _WIN32 && QT_VERSION < QT_VERSION_CHECK(5, 15, 10) -// From 5.15.2 to 5.15.10, Accessibility freeze the application on Windows: Deactivate handlers. +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 10) +// From 5.15.2 to 5.15.10, sometimes, Accessibility freeze the application : Deactivate handlers. #define ACCESSBILITY_WORKAROUND #include #include diff --git a/linphone-app/ui/views/App/Calls/Incall.qml b/linphone-app/ui/views/App/Calls/Incall.qml index 784e7cd85..1ca815521 100644 --- a/linphone-app/ui/views/App/Calls/Incall.qml +++ b/linphone-app/ui/views/App/Calls/Incall.qml @@ -451,17 +451,17 @@ Rectangle { iconIsCustom: ! (callModel.isSecured && SettingsModel.isPostQuantumAvailable && callModel.encryption === CallModel.CallEncryptionZrtp) backgroundRadius: width/2 - colorSet: callModel.isSecured - ? SettingsModel.isPostQuantumAvailable && callModel.encryption === CallModel.CallEncryptionZrtp && callModel.isPQZrtp == CallModel.CallPQStateOn - ? IncallStyle.buttons.postQuantumSecure - : IncallStyle.buttons.secure - : IncallStyle.buttons.unsecure - + colorSet: !callModel || callModel.encryption === CallModel.CallEncryptionNone + ? IncallStyle.buttons.unsecure + : callModel.isSecured + ? SettingsModel.isPostQuantumAvailable && callModel.encryption === CallModel.CallEncryptionZrtp && callModel.isPQZrtp == CallModel.CallPQStateOn + ? IncallStyle.buttons.postQuantumSecure + : IncallStyle.buttons.secure2 + : IncallStyle.buttons.secure onClicked: if(callModel.encryption === CallModel.CallEncryptionZrtp){ window.attachVirtualWindow(Utils.buildLinphoneDialogUri('ZrtpTokenAuthenticationDialog'), {call:callModel}) } - - tooltipText: Logic.makeReadableSecuredString(callModel.isSecured, callModel.securedString) + tooltipText: callModel ? Logic.makeReadableSecuredString(callModel.encryption !== CallModel.CallEncryptionNone, callModel.securedString) : '' } RowLayout{ visible: callModel.remoteRecording diff --git a/linphone-app/ui/views/App/Calls/IncallActiveSpeaker.qml b/linphone-app/ui/views/App/Calls/IncallActiveSpeaker.qml index 747ad1772..7b7579a01 100644 --- a/linphone-app/ui/views/App/Calls/IncallActiveSpeaker.qml +++ b/linphone-app/ui/views/App/Calls/IncallActiveSpeaker.qml @@ -129,6 +129,7 @@ Item { onRequestResetPosition: resetPosition() } } + Item{ id: miniViewArea anchors.right: parent.right @@ -140,6 +141,12 @@ Item { //--------------- width: 16 * miniViews.cellHeight / 9 visible: mainItem.isConferenceReady || !mainItem.isConference + property int heightLeft: parent.height - preview.height + onHeightLeftChanged: {Qt.callLater(miniViewArea.forceRefresh)} + function forceRefresh(){// Force a content refresh via margins. Qt is buggy when managing sizes in ListView. + ++miniViewArea.anchors.topMargin + --miniViewArea.anchors.topMargin + } ScrollableListView{ id: miniViews @@ -150,13 +157,8 @@ Item { verticalLayoutDirection: ListView.BottomToTop fitCacheToContent: false property int oldCount : 0// Count changed can be called without a change... (bug?). Use oldCount to avoid it. - onCountChanged: {if(oldCount != count){ oldCount = count ; Qt.callLater(forceRefresh)}} - onHeightChanged: Qt.callLater(forceRefresh) - function forceRefresh(){// Force a content refresh via margins. Qt is buggy when managing sizes in ListView. - ++miniViewArea.anchors.topMargin - --miniViewArea.anchors.topMargin - } - Component.onCompleted: {Qt.callLater(forceRefresh)} + onCountChanged: {if(oldCount != count){ oldCount = count ; Qt.callLater(miniViewArea.forceRefresh)}} + Component.onCompleted: {Qt.callLater(miniViewArea.forceRefresh)} delegate:Item{ height: visible ? miniViews.cellHeight + 15 : 0 width: visible ? miniViews.width : 0 diff --git a/linphone-app/ui/views/App/Calls/IncallFullscreen.qml b/linphone-app/ui/views/App/Calls/IncallFullscreen.qml index aefff5528..11093efe8 100644 --- a/linphone-app/ui/views/App/Calls/IncallFullscreen.qml +++ b/linphone-app/ui/views/App/Calls/IncallFullscreen.qml @@ -400,18 +400,19 @@ Window { isCustom: true iconIsCustom: ! (conference.isSecured && SettingsModel.isPostQuantumAvailable && callModel.encryption === CallModel.CallEncryptionZrtp) backgroundRadius: width/2 - - colorSet: conference.isSecured - ? SettingsModel.isPostQuantumAvailable && callModel.encryption === CallModel.CallEncryptionZrtp && callModel.isPQZrtp == CallModel.CallPQStateOn - ? IncallStyle.buttons.postQuantumSecure - : IncallStyle.buttons.secure - : IncallStyle.buttons.unsecure + colorSet: !callModel || callModel.encryption === CallModel.CallEncryptionNone + ? IncallStyle.buttons.unsecure + : callModel.isSecured + ? SettingsModel.isPostQuantumAvailable && callModel.encryption === CallModel.CallEncryptionZrtp && callModel.isPQZrtp == CallModel.CallPQStateOn + ? IncallStyle.buttons.postQuantumSecure + : IncallStyle.buttons.secure2 + : IncallStyle.buttons.secure onClicked: if(callModel.encryption === CallModel.CallEncryptionZrtp){ window.attachVirtualWindow(Utils.buildLinphoneDialogUri('ZrtpTokenAuthenticationDialog'), {call:callModel}) } - tooltipText: Logic.makeReadableSecuredString(conference.isSecured, callModel ? callModel.securedString : '') + tooltipText: callModel ? Logic.makeReadableSecuredString(callModel.encryption !== CallModel.CallEncryptionNone, callModel.securedString) : '' } RowLayout{ visible: callModel && callModel.remoteRecording @@ -483,7 +484,7 @@ Window { interval: 50 repeat: true running: parent.enabled - onTriggered: parent.value = callModel.speakerVu + onTriggered: if(callModel) parent.value = callModel.speakerVu } } ActionSwitch {