mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
fix mouse cursor stolen by mouse area
This commit is contained in:
parent
dfe0c5cbe9
commit
b25cf4ff15
2 changed files with 13 additions and 11 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue