diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index 7bb2f924c..2383f9c2f 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -758,6 +758,10 @@ void App::setCoreStarted(bool started) { } } +static QObject *findParentWindow(QObject *item) { + return !item || item->isWindowType() ? item : findParentWindow(item->parent()); +} + bool App::notify(QObject *receiver, QEvent *event) { bool done = true; try { @@ -767,6 +771,15 @@ bool App::notify(QObject *receiver, QEvent *event) { } catch (...) { lCritical() << log().arg("Generic exeption has been catch in notify"); } + if (event->type() == QEvent::MouseButtonPress) { + auto window = findParentWindow(receiver); + if (getMainWindow() == window) { + auto defaultAccountCore = mAccountList->getDefaultAccountCore(); + if (defaultAccountCore && defaultAccountCore->getUnreadCallNotifications() > 0) { + emit defaultAccountCore->lResetMissedCalls(); + } + } + } return done; } diff --git a/Linphone/view/Page/Layout/Main/MainLayout.qml b/Linphone/view/Page/Layout/Main/MainLayout.qml index a033e7502..99f5d4388 100644 --- a/Linphone/view/Page/Layout/Main/MainLayout.qml +++ b/Linphone/view/Page/Layout/Main/MainLayout.qml @@ -78,17 +78,6 @@ Item { sourceModel: AppCpp.calls } - MouseArea { - anchors.fill: parent - focus: true - z: 100 - onPressed: { - if (mainStackView.currentItem.objectName === "mainStackLayout" && mainStackView.currentItem.currentIndex === 0 - && accountProxy.defaultAccount && accountProxy.defaultAccount.core.unreadCallNotifications > 0) accountProxy.defaultAccount.core.lResetMissedCalls() - mouse.accepted = false - } - } - Item{ Popup { id: currentCallNotif