From 6aa57414c0a49bf0c74ae4a2c1dbee7445b95d69 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 7 Feb 2023 16:26:17 +0100 Subject: [PATCH] - Remove the use processEvents that can lead to a deadlock from iterate. - Add a loading page while building the call view instead of a blank one. --- .../src/components/call/CallModel.cpp | 1 - .../components/chat-room/ChatRoomModel.cpp | 1 - .../ui/views/App/Calls/CallsWindow.qml | 51 +++++++++++++------ 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp index 784df5f96..fa7ce6bd0 100644 --- a/linphone-app/src/components/call/CallModel.cpp +++ b/linphone-app/src/components/call/CallModel.cpp @@ -582,7 +582,6 @@ void CallModel::accept (bool withVideo) { } else App::smartShowWindow(callsWindow); } - qApp->processEvents(); // Process GUI events before accepting in order to be synchronized with Call objects and be ready to get SDK events shared_ptr core = coreManager->getCore(); if(mCall) { shared_ptr params = core->createCallParams(mCall); diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.cpp b/linphone-app/src/components/chat-room/ChatRoomModel.cpp index 096093168..5f16d932d 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.cpp @@ -966,7 +966,6 @@ void ChatRoomModel::setEntriesLoading(const bool& loading){ if( mEntriesLoading != loading){ mEntriesLoading = loading; emit entriesLoadingChanged(mEntriesLoading); - qApp->processEvents(); } } diff --git a/linphone-app/ui/views/App/Calls/CallsWindow.qml b/linphone-app/ui/views/App/Calls/CallsWindow.qml index bb4176ba3..1b198a8dd 100644 --- a/linphone-app/ui/views/App/Calls/CallsWindow.qml +++ b/linphone-app/ui/views/App/Calls/CallsWindow.qml @@ -6,6 +6,7 @@ import Common 1.0 import Linphone 1.0 import App.Styles 1.0 +import Common.Styles 1.0 import 'CallsWindow.js' as Logic @@ -268,22 +269,42 @@ Window { // ----------------------------------------------------------------------- - childA: Loader { - id: middlePane + childA: Rectangle{ anchors.fill: parent - sourceComponent: Logic.getContent(window.call, window.conferenceInfoModel) - property var lastComponent: null - onSourceComponentChanged: { - if(lastComponent != sourceComponent){ - if( sourceComponent == waitingRoom) - mainPaned.close() - rightPaned.childAItem.update() - if(!sourceComponent && calls.count == 0) - window.close() - lastComponent = sourceComponent - } - }// Force update when loading a new Content. It's just to be sure - active: window.call || window.conferenceInfoModel + color: 'transparent' + ColumnLayout { + id: waitingPage + anchors.fill: parent + visible: middlePane.status != Loader.Ready || !middlePane.sourceComponent + Loader{ + Layout.preferredHeight: 40 + Layout.preferredWidth: 40 + Layout.alignment: Qt.AlignCenter + active: waitingPage.visible + sourceComponent: Component{ + BusyIndicator{ + color: BusyIndicatorStyle.alternateColor.color + } + } + } + } + Loader { + id: middlePane + anchors.fill: parent + sourceComponent: Logic.getContent(window.call, window.conferenceInfoModel) + property var lastComponent: null + onSourceComponentChanged: { + if(lastComponent != sourceComponent){ + if( sourceComponent == waitingRoom) + mainPaned.close() + rightPaned.childAItem.update() + if(!sourceComponent && calls.count == 0) + window.close() + lastComponent = sourceComponent + } + }// Force update when loading a new Content. It's just to be sure + active: window.call || window.conferenceInfoModel + } } childB: Loader {