Return early if close button accepts input event

Summary:
Otherwise we close the effect whenever the close is pressed which is a
behavioural change.

That in turn leads to bigger bugs

BUG: 415155

Test Plan:
Ran effect
Clicked on the "Whitespace" of the dash
Clicked on the close

Now matches desktopgrid code

Reviewers: #kwin, zzag, ngraham

Reviewed By: #kwin, zzag, ngraham

Subscribers: ngraham, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27333
This commit is contained in:
David Edmundson 2020-02-12 10:03:39 +02:00
parent b94a78c47d
commit 3dbfa6a325

View file

@ -538,6 +538,7 @@ void PresentWindowsEffect::windowInputMouseEvent(QEvent *e)
if (!me) {
return;
}
me->setAccepted(false);
if (m_closeView) {
const bool contains = m_closeView->geometry().contains(me->pos());
if (!m_closeView->isVisible() && contains) {
@ -545,6 +546,9 @@ void PresentWindowsEffect::windowInputMouseEvent(QEvent *e)
}
m_closeView->forwardMouseEvent(e);
}
if (e->isAccepted()) {
return;
}
inputEventUpdate(me->pos(), me->type(), me->button());
}