From c3daf71f7da0199331f7884f0b822cf426bf196c Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 24 Aug 2023 16:59:02 +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 | 8 ++++++++ linphone-app/src/app/App.cpp | 19 ++++++++++++++++++- linphone-app/src/app/main.cpp | 4 ++-- linphone-app/ui/views/App/Calls/Incall.qml | 4 ++-- .../views/App/Calls/IncallActiveSpeaker.qml | 16 +++++++++------- .../ui/views/App/Calls/IncallFullscreen.qml | 6 +++--- 6 files changed, 42 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d29e1776..dc37a275a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. 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 fbf5e8527..2bf7c6a4b 100644 --- a/linphone-app/ui/views/App/Calls/Incall.qml +++ b/linphone-app/ui/views/App/Calls/Incall.qml @@ -451,7 +451,7 @@ Rectangle { iconIsCustom: ! (callModel.isSecured) backgroundRadius: width/2 - colorSet: callModel.encryption === CallModel.CallEncryptionNone + colorSet: !callModel || callModel.encryption === CallModel.CallEncryptionNone ? IncallStyle.buttons.unsecure : callModel.isSecured ? SettingsModel.isPostQuantumAvailable && callModel.encryption === CallModel.CallEncryptionZrtp && callModel.isPQZrtp == CallModel.CallPQStateOn @@ -462,7 +462,7 @@ Rectangle { window.attachVirtualWindow(Utils.buildLinphoneDialogUri('ZrtpTokenAuthenticationDialog'), {call:callModel}) } - tooltipText: Logic.makeReadableSecuredString(callModel.encryption !== CallModel.CallEncryptionNone, 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 6b42391f3..e5e6f3a8b 100644 --- a/linphone-app/ui/views/App/Calls/IncallFullscreen.qml +++ b/linphone-app/ui/views/App/Calls/IncallFullscreen.qml @@ -401,7 +401,7 @@ Window { iconIsCustom: ! (conference.isSecured && SettingsModel.isPostQuantumAvailable && callModel.encryption === CallModel.CallEncryptionZrtp) backgroundRadius: width/2 - colorSet: callModel.encryption === CallModel.CallEncryptionNone + colorSet: !callModel || callModel.encryption === CallModel.CallEncryptionNone ? IncallStyle.buttons.unsecure : callModel.isSecured ? SettingsModel.isPostQuantumAvailable && callModel.encryption === CallModel.CallEncryptionZrtp && callModel.isPQZrtp == CallModel.CallPQStateOn @@ -413,7 +413,7 @@ Window { window.attachVirtualWindow(Utils.buildLinphoneDialogUri('ZrtpTokenAuthenticationDialog'), {call:callModel}) } - tooltipText: Logic.makeReadableSecuredString(callModel.encryption !== CallModel.CallEncryptionNone, callModel ? callModel.securedString : '') + tooltipText: callModel ? Logic.makeReadableSecuredString(callModel.encryption !== CallModel.CallEncryptionNone, callModel.securedString) : '' } RowLayout{ visible: callModel && callModel.remoteRecording @@ -485,7 +485,7 @@ Window { interval: 50 repeat: true running: parent.enabled - onTriggered: parent.value = callModel.speakerVu + onTriggered: if(callModel) parent.value = callModel.speakerVu } } ActionSwitch {