From 418a000eee85dabbb4796a4bce3b429c503c1d8f Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Wed, 23 Mar 2022 17:19:59 +0100 Subject: [PATCH] - Show logs in console if launched from it. - Fix speaker icon in fullscreen. - Remove MouseArea from OpacityMask. - Fix crash on ZRTP and fix windows on SoundPlayer - fix Wasapi buffer --- linphone-app/src/app/main.cpp | 67 ++++++++++++------- .../src/components/timeline/TimelineModel.cpp | 3 +- .../ui/modules/Common/Form/ActionButton.qml | 28 +++----- .../App/Calls/IncallFullscreenWindow.qml | 6 +- linphone-sdk | 2 +- 5 files changed, 58 insertions(+), 48 deletions(-) diff --git a/linphone-app/src/app/main.cpp b/linphone-app/src/app/main.cpp index dd63d07f9..30c352599 100644 --- a/linphone-app/src/app/main.cpp +++ b/linphone-app/src/app/main.cpp @@ -24,37 +24,58 @@ #include #endif #include +#ifdef _WIN32 +#include +FILE * gStream = NULL; +#endif #include "components/core/CoreManager.hpp" // ============================================================================= +void cleanStream(){ +#ifdef _WIN32 + if(gStream) { + fflush(stdout); + fflush(stderr); + fclose(gStream); + } +} +#endif + int main (int argc, char *argv[]) { #ifdef __APPLE__ qputenv("QT_ENABLE_GLYPH_CACHE_WORKAROUND", "1"); // On Mac, set this workaround to avoid glitches on M1, because of https://bugreports.qt.io/browse/QTBUG-89379 +#elif defined _WIN32 + // log in console only if launched from console + if (AttachConsole(ATTACH_PARENT_PROCESS)) { + freopen_s(&gStream, "CONOUT$", "w", stdout); + freopen_s(&gStream, "CONOUT$", "w", stderr); + } #endif - AppController controller(argc, argv); + AppController controller(argc, argv); #ifdef QT_QML_DEBUG - QQmlDebuggingEnabler enabler; + QQmlDebuggingEnabler enabler; #endif - //QLoggingCategory::setFilterRules("*.debug=true;qml=false"); - App *app = controller.getApp(); - - if (app->isSecondary()) - { - qInfo() << QStringLiteral("Running secondary app success. Kill it now."); - return EXIT_SUCCESS; - } - - qInfo() << QStringLiteral("Running app..."); - - int ret; - do { - app->initContentApp(); - ret = app->exec(); - } while (ret == App::RestartCode); - auto core = CoreManager::getInstance()->getCore(); - if(core && core->getGlobalState() == linphone::GlobalState::On) - core->stop(); - - return ret; + //QLoggingCategory::setFilterRules("*.debug=true;qml=false"); + App *app = controller.getApp(); + + if (app->isSecondary()) + { + qInfo() << QStringLiteral("Running secondary app success. Kill it now."); + cleanStream(); + return EXIT_SUCCESS; + } + + qInfo() << QStringLiteral("Running app..."); + + int ret; + do { + app->initContentApp(); + ret = app->exec(); + } while (ret == App::RestartCode); + auto core = CoreManager::getInstance()->getCore(); + if(core && core->getGlobalState() == linphone::GlobalState::On) + core->stop(); + cleanStream(); + return ret; } diff --git a/linphone-app/src/components/timeline/TimelineModel.cpp b/linphone-app/src/components/timeline/TimelineModel.cpp index 752c9819a..82492ab50 100644 --- a/linphone-app/src/components/timeline/TimelineModel.cpp +++ b/linphone-app/src/components/timeline/TimelineModel.cpp @@ -129,7 +129,8 @@ void TimelineModel::setSelected(const bool& selected){ << ", ephemeralEnabled:" << mChatRoomModel->isEphemeralEnabled() << ", isAdmin:"<< mChatRoomModel->isMeAdmin() << ", canHandleParticipants:"<< mChatRoomModel->canHandleParticipants() - << ", isReadOnly:" << mChatRoomModel->isReadOnly(); + << ", isReadOnly:" << mChatRoomModel->isReadOnly() + << ", state:" << mChatRoomModel->getState(); } emit selectedChanged(mSelected); } diff --git a/linphone-app/ui/modules/Common/Form/ActionButton.qml b/linphone-app/ui/modules/Common/Form/ActionButton.qml index dadd0159a..9bb2281cd 100644 --- a/linphone-app/ui/modules/Common/Form/ActionButton.qml +++ b/linphone-app/ui/modules/Common/Form/ActionButton.qml @@ -256,18 +256,12 @@ Item { visible: !isCustom } - + OpacityMask{ anchors.fill: foregroundColor source: foregroundColor maskSource: icon visible: isCustom - MouseArea{ - anchors.fill:parent - hoverEnabled: true - acceptedButtons: Qt.NoButton - cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor - } } @@ -277,19 +271,13 @@ Item { source: foregroundHiddenPartColor maskSource: icon visible: isCustom && percentageDisplayed != 100 - /* - layer { - enabled: true - effect: ColorOverlay { - color: "#80FFFFFF" - } - }*/ - MouseArea{ - anchors.fill:parent - hoverEnabled: true - acceptedButtons: Qt.NoButton - cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor - } + + } + MouseArea{ + anchors.fill:parent + hoverEnabled: true + acceptedButtons: Qt.NoButton + cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor } TooltipArea { id:tooltip diff --git a/linphone-app/ui/views/App/Calls/IncallFullscreenWindow.qml b/linphone-app/ui/views/App/Calls/IncallFullscreenWindow.qml index a7d467c62..87093d03d 100644 --- a/linphone-app/ui/views/App/Calls/IncallFullscreenWindow.qml +++ b/linphone-app/ui/views/App/Calls/IncallFullscreenWindow.qml @@ -348,17 +348,17 @@ Window { Timer { interval: 50 repeat: true - running: speaker.enabled + running: parent.enabled onTriggered: parent.value = call.speakerVu } - enabled: speaker.enabled + enabled: !speaker.muted } ActionButton { id: speaker - property bool muted : call && !call.speakerMuted + property bool muted : call && call.speakerMuted isCustom: true backgroundRadius: 90 colorSet: muted ? CallFullscreenStyle.buttons.speakerOff : CallFullscreenStyle.buttons.speakerOn diff --git a/linphone-sdk b/linphone-sdk index 813fc494f..340bc9a1a 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 813fc494f2a4d951eea6e99d4d1a6353a855c0b2 +Subproject commit 340bc9a1a682cfb5feb4751280e1b94693ee0ce1