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.
This commit is contained in:
Julien Wadel 2023-08-25 14:08:59 +02:00
parent 42b898c13c
commit 53d79ef48b
6 changed files with 53 additions and 26 deletions

View file

@ -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

View file

@ -336,6 +336,7 @@ void App::processArguments(QHash<QString,QString> 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<QQuickWindow *>(object);
int totalDuration = 0;
int loops = 0;
QElapsedTimer timer;
timer.start();
auto window = qobject_cast<QQuickWindow *>(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;
}
// -----------------------------------------------------------------------------

View file

@ -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 <QAccessibleEvent>
#include <QAccessible>

View file

@ -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

View file

@ -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

View file

@ -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 {