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 App::notify(QObject *receiver, QEvent *event) {
|
||||||
bool done = true;
|
bool done = true;
|
||||||
try {
|
try {
|
||||||
|
|
@ -767,6 +771,15 @@ bool App::notify(QObject *receiver, QEvent *event) {
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
lCritical() << log().arg("Generic exeption has been catch in notify");
|
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;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,17 +78,6 @@ Item {
|
||||||
sourceModel: AppCpp.calls
|
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{
|
Item{
|
||||||
Popup {
|
Popup {
|
||||||
id: currentCallNotif
|
id: currentCallNotif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue